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
#https://api.rubyonrails.org/classes/ActionView/Helpers/CacheHelper.html#method-i-cache | |
ActionView::Digestor.digest(name: 'blog/show', finder: ActionController::Base.new.lookup_context) |
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
# npm post install script to browserify redux instead of using webpack | |
# https://github.com/reactjs/redux/ | |
# setup dependencies | |
$ npm install browserify --save-dev | |
$ npm install browserify-incremental --save-dev | |
$ npm install babelify --save-dev | |
$ npm install babel-preset-stage-2 --save-dev | |
$ npm install babel-preset-es2015 --save-dev | |
$ npm install babel-preset-react --save-dev |
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
diff --git a/chosen.ajaxaddition.jquery.js b/chosen.ajaxaddition.jquery.js | |
index c60ccfd..691cdac 100644 | |
--- a/chosen.ajaxaddition.jquery.js | |
+++ b/chosen.ajaxaddition.jquery.js | |
@@ -41,7 +41,8 @@ | |
selected, valuesArray, valuesHash = {}, | |
requestQueueLength = requestQueue.length, | |
old = false, | |
- keep = false; | |
+ keep = false, |
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
it("should allow the last character to be deleted", function(){ | |
var chosen, | |
input, | |
key, | |
returnQuery, | |
clock = sinon.useFakeTimers(), | |
xhr = sinon.useFakeXMLHttpRequest(), | |
requests = []; | |
xhr.onCreate = function (xhr) { requests.push(xhr) }; |
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
#!/bin/bash | |
str="a@b.com;b@c.com;d@e.com" | |
delimiter=";" | |
declare -a arr | |
arr=(`echo ${str//$delimiter/ }`) | |
#get "keys" - ${!arr[@]} | |
for i in "${!arr[@]}"; do | |
printf "%s\t%s\n" "$i" "${arr[$i]}" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
html, body { margin:0px;padding:0px;height:100%;width:100%; } | |
#left-side { float:left;background-color:#E5EBF2;width:25%;border-right: 1px solid #B4B4B4;height:100%; } | |
#right-side { float:left;position:relative;height:100%;width:70%; } | |
#floater { background-color:lightgray;position:absolute;padding:5px;width:365px;top:20px;left:-15px;-moz-box-shadow: 0 4px 8px rgba(0,0,0,0.6);-webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.6);-o-box-shadow: 0 4px 8px rgba(0,0,0,0.6);box-shadow: 0 4px 8px rgba(0,0,0,0.6); } | |
/*the `magic`*/ | |
#floater { overflow-y:auto;height:auto;max-height:90%; } |
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
function beginningOfMonth(date){ | |
if(typeof date === 'undefined'){ | |
date = new Date(); | |
} | |
date.setMilliseconds(0); | |
date.setSeconds(0); | |
date.setMinutes(0); | |
date.setHours(0); | |
date.setDate(1); | |
return new Date(date); |
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
// $('img.photo',this).imagesLoaded(myFunction) | |
// execute a callback when all images have loaded. | |
// needed because .load() doesn't work on cached images | |
// mit license. paul irish. 2010. | |
// webkit fix from Oren Solomianik. thx! | |
// callback function is passed the last image to load | |
// as an argument, and the collection as `this` |
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
# The goal is to traverse a tree and return an array A[0...h], where h is the height | |
# of the tree and A[i] is an array of items at height i. | |
# example: | |
# tree -> | |
# 0 | |
# 1 2 | |
# 3 4 5 6 | |
# 7 8 9 10 11 12 13 14 | |
# | |
# should give you: |
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
//routes/ppm | |
export default Ember.Route.extend({ | |
actions: { | |
openModal: function() { | |
this.render('ingredientSelect', { | |
into: 'ppm', | |
outlet: 'modal' | |
}); | |
}, | |
closeModal: function() { |
NewerOlder