Skip to content

Instantly share code, notes, and snippets.

View kissu's full-sized avatar
🌱

Konstantin BIFERT kissu

🌱
View GitHub Profile
@kissu
kissu / unauthorized_cross-origin_response_fix.rb
Created November 7, 2017 17:20 — forked from aishek/unauthorized_cross-origin_response_fix.rb
Fixes unauthorized cross-origin response problem for .js templates (problem description in Russian http://habrahabr.ru/post/209618/) in Ruby On Rails 3.2. For Rails 4 just save https://raw2.github.com/rails/rails/4f4fdd643f9d19fbbeeec3ac77674f791c9beffa/actionpack/lib/action_controller/metal/request_forgery_protection.rb to config/initializers/u…
# config/initializers/unauthorized_cross-origin_response_fix.rb
#
# Fixes unauthorized cross-origin response problem for .js templates (problem description in Russian http://habrahabr.ru/post/209618/)
# in Ruby On Rails 3.2, idea and code extracted from https://github.com/rails/rails/blob/4f4fdd643f9d19fbbeeec3ac77674f791c9beffa/actionpack/lib/action_controller/metal/request_forgery_protection.rb
#
# for Rails 4 just save https://raw2.github.com/rails/rails/4f4fdd643f9d19fbbeeec3ac77674f791c9beffa/actionpack/lib/action_controller/metal/request_forgery_protection.rb
# to config/initializers/unauthorized_cross-origin_response_fix.rb
#
# for Rails 4.1 there is https://github.com/rails/rails/pull/13345)
@kissu
kissu / unauthorized_cross-origin_response_fix.rb
Created November 7, 2017 17:20 — forked from aishek/unauthorized_cross-origin_response_fix.rb
Fixes unauthorized cross-origin response problem for .js templates (problem description in Russian http://habrahabr.ru/post/209618/) in Ruby On Rails 3.2. For Rails 4 just save https://raw2.github.com/rails/rails/4f4fdd643f9d19fbbeeec3ac77674f791c9beffa/actionpack/lib/action_controller/metal/request_forgery_protection.rb to config/initializers/u…
# config/initializers/unauthorized_cross-origin_response_fix.rb
#
# Fixes unauthorized cross-origin response problem for .js templates (problem description in Russian http://habrahabr.ru/post/209618/)
# in Ruby On Rails 3.2, idea and code extracted from https://github.com/rails/rails/blob/4f4fdd643f9d19fbbeeec3ac77674f791c9beffa/actionpack/lib/action_controller/metal/request_forgery_protection.rb
#
# for Rails 4 just save https://raw2.github.com/rails/rails/4f4fdd643f9d19fbbeeec3ac77674f791c9beffa/actionpack/lib/action_controller/metal/request_forgery_protection.rb
# to config/initializers/unauthorized_cross-origin_response_fix.rb
#
# for Rails 4.1 there is https://github.com/rails/rails/pull/13345)
Export new path variable to `$PATH`
echo 'export PATH=$PATH:/home/kissu/appImages' >> ~/.zshrc
@kissu
kissu / getProperty.js
Created January 7, 2021 15:44 — forked from jasonrhodes/getProperty.js
Get a nested object property by passing a dot notation string as the property name
/**
* A function to take a string written in dot notation style, and use it to
* find a nested object property inside of an object.
*
* Useful in a plugin or module that accepts a JSON array of objects, but
* you want to let the user specify where to find various bits of data
* inside of each custom object instead of forcing a standardized
* property list.
*
* @param String nested A dot notation style parameter reference (ie "urls.small")
{
mode: 'development',
context: '/Users/kissu/code/vue3-webpack',
output: {
hashFunction: 'xxhash64',
path: '/Users/kissu/code/vue3-webpack/dist',
filename: 'js/[name].js',
publicPath: '/',
chunkFilename: 'js/[name].js'
},
@kissu
kissu / coach_answer.rb
Created January 21, 2025 17:20
Programming Basics
def coach_answer(your_message)
if your_message.upcase == "I AM GOING TO WORK RIGHT NOW!"
return ""
elsif your_message.end_with?("?")
return "Silly question, get dressed"
else
return "I don't care"
end
end
@kissu
kissu / acronym.rb
Last active January 23, 2025 09:35
def acronym(sentence)
# we split the sentence into words
# grab first letter of each word
# join the first letters
final = []
array_of_words = sentence.split(' ')
array_of_words.each do |word|
final << word[0].upcase
# p final
@kissu
kissu / acronym.rb
Created January 23, 2025 21:06
Yield day with plenty of iterators + RSpec
def acronym(sentence)
return sentence.split.map { |word| word[0] }.join.upcase
end
@kissu
kissu / index.html
Created February 10, 2025 17:29
Dribble copycat
<html>
<head>
<title>Dribbble card</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="card-container">
@kissu
kissu / button.css
Created February 11, 2025 21:26
And example of a possible Dribble bucket integration
.btn-green {
text-decoration: none;
background-color: #3DBF59;
padding: 8px;
margin-top: 8px;
color: white;
width: 100%;
display: inline-block;
text-align: center;
}