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
//routes/ppm | |
export default Ember.Route.extend({ | |
actions: { | |
openModal: function() { | |
this.render('ingredientSelect', { | |
into: 'ppm', | |
outlet: 'modal' | |
}); | |
}, | |
closeModal: function() { |
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
asyncTest("#handleFindQuery passing in associations", function() { | |
var name = 'banana', | |
users = FactoryGuy.buildList('user', 2, 'with_projects', { name: name }); | |
testHelper.handleFindQuery('user', ['name'], users); | |
store.findQuery('user', {name: name}).then(function (users) { | |
//TypeError: Cannot read property 'typeKey' of undefined | |
//at Ember.Object.extend.modelFor (file:///Users/employee/projects/kys-ember-data-factory-guy/bower_components/ember-data/ember-data.js:11437:22) | |
start(); |
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
#http://www.trywildcard.com/challenge/problem2 | |
GENERATION = [9 , 10, 21, 20, 7, 11, 4, 15, 7, 7, 14, 5, 20, 6, 29, 8, 11, 19, 18, 22, 29, 14, 27, 17, 6, 22, 12, 18, 18, 30] | |
OVERHEAD = [21, 16, 19, 26, 26, 7, 1, 8, 17, 14, 15, 25, 20, 3, 24, 5, 28, 9, 2, 14, 9, 25, 15, 13, 15, 9, 6, 20, 27, 22] | |
BUDGET = ARGV[0].to_i #2912 | |
def binary_search_insert(list, obj) | |
high = list.length | |
low = 0 | |
mid = 0 | |
direction = -1 |
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
#http://www.trywildcard.com/challenge/problem1 | |
FILE = ARGV[0] #problem1input.txt | |
NUMBEROFCARDS = ARGV[1].to_i #5 | |
def factorial(n) | |
( (1..n).reduce(:*) || 1 ) | |
end | |
columns = [] | |
total = 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
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="[email protected];[email protected];[email protected]" | |
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%; } |
NewerOlder