This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery plugin to prevent double click | |
jQuery.fn.preventDoubleClick = function() { | |
$(this).on('click', function(e){ | |
var $el = $(this); | |
if($el.data('clicked')){ | |
// Previously clicked, stop actions | |
e.preventDefault(); | |
e.stopPropagation(); | |
}else{ | |
// Mark to ignore next click |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# credits: http://www.physics.sfasu.edu/astro/color/spectra.html | |
# Calculates an RGB color based on factor betwen 0 (380nm) and 1 (780nm) | |
def color_by_factor(f) | |
f = f.to_f | |
max = 255.0 | |
wl = 380.0 + (780.0 - 380.0) * f | |
if wl >= 380 and wl <= 440 | |
r = -1.0 * (wl - 440.0)/(440.0 - 380.0) | |
g = 0.0 | |
b = 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
class Person | |
@age = nil | |
attr_accessor :json_field, :age | |
def initialize *args | |
# useful for Rails ApplicationRecord models | |
args[0].each{|key, value| self.send("#{key}=".to_sym, value)} | |
# uncomment next line for inherited classes | |
# super *args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create function in | |
// cloudfront / | |
// functions | |
// Create distribution in | |
// cloudfront / | |
// distributions | |
// Associate function to distribution in | |
// cloudfront / | |
// distributions / | |
// YOUR_DIST / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.colorCustomizations": { | |
"terminal.foreground": "#839496", | |
"terminal.background": "#002833", | |
"terminal.ansiBlack": "#003541", | |
"terminal.ansiBlue": "#268bd2", | |
"terminal.ansiCyan": "#2aa198", | |
"terminal.ansiGreen": "#859901", | |
"terminal.ansiMagenta": "#d33682", | |
"terminal.ansiRed": "#dc322f", |