This file contains hidden or 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
| var L = window.SafeLogger = window.SafeLogger || {}; | |
| // | |
| // from server or on a specific page you want console data | |
| // L.__debug__ = true | |
| // | |
| L.log = function() { | |
| if (window.console && L.__debug__) { | |
| // TODO: Chrome doesn't let us call apply on console.log. | |
| // Interpolate variable arguments manually and construct | |
| // a single-argument call to console.log for Chrome. |
This file contains hidden or 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
| alias lookfor="history | grep" |
This file contains hidden or 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
| rebase_prep() { | |
| git checkout master && git pull && git checkout - | |
| } |
This file contains hidden or 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
| [alias] | |
| rebaseprep = !sh -c 'git checkout master && git pull && git checkout -' |
This file contains hidden or 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
| <VirtualHost *:80> | |
| ServerName sinatra.yourserver.com | |
| ServerAlias sinatra.yourserver.com | |
| DocumentRoot /home/your_app_user/webapp/current | |
| RewriteEngine On | |
| <Proxy balancer://thinservers> | |
| BalancerMember http://127.0.0.1:5000 | |
| BalancerMember http://127.0.0.1:5001 |
This file contains hidden or 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 boilerplate | |
| // this plugin has methods and manages separate settings for each instance | |
| $.myPluginDefaults = { | |
| imageContainer: '.ir_img_container', | |
| imageUrls: [] | |
| }; | |
| $.fn.myPlugin = function( method ) { | |
| var inArgs = arguments; |
This file contains hidden or 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
| __from_ssh_config() { | |
| SSHCONFIG=$HOME/.ssh/config | |
| COMPREPLY=() | |
| local cur=${COMP_WORDS[COMP_CWORD]} | |
| COMPREPLY=($(compgen -W '$(cat ~/.ssh/config | grep Host | cut -d" " -f2-)' -- $cur)) | |
| } | |
| complete -F __from_ssh_config -o default ssh |
This file contains hidden or 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
| def tally inp; hash = Hash.new(0); inp.each {|k,v| hash[k] +=v}; hash; end | |
| def histogram inp; hash = Hash.new(0); inp.each {|v| hash[v]+=1}; hash; end | |
| def histogram2 inp; Hash[*inp.group_by{ |v| v }.flat_map{ |k, v| [k, v.size] }] end | |
| def test_tally | |
| tally([['a',1],['b',1],['a',1],['c',1],['a',3], ['c',1]]) == {'a'=>5, 'b'=>1, 'c'=>2} | |
| end | |
| def test_histogram | |
| histogram(['a','b','a','c','a', 'c']) == {'a'=>3, 'b'=>1, 'c'=>2} |
This file contains hidden or 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
| jasmine.Spec.prototype.execute = function(onComplete) { | |
| var spec = this; | |
| var descs = []; | |
| var suite = this.suite; | |
| while (suite) { | |
| descs.push(suite.description); | |
| suite = suite.parentSuite; | |
| } | |
| descs = descs.reverse(); | |
| descs.push(this.description) |
This file contains hidden or 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
| Options -Indexes |
OlderNewer