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 myfunc(arg) | |
puts arg | |
end | |
dict = {} | |
dict['greet'] = method(:myfunc) | |
f = dict['greet'] | |
f.call('Hello World') |
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
public class Greeter | |
{ | |
public static void Main() | |
{ | |
System.Console.WriteLine("Hello, World!"); | |
} | |
} |
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
require 'simplecov' | |
SimpleCov.start | |
require 'r2do' |
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
rvm: # the Ruby environments you want to test against | |
- 1.8.7 | |
- 1.9.2 | |
- 1.9.3 | |
- jruby | |
- rbx | |
script: "bundle exec rake test" # your test command! |
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
/* | |
* Bearer strategy for token authentication when accessing API endpoints | |
*/ | |
passport.use(new BearerStrategy( | |
function(token, done){ | |
try { | |
//we attempt to decode the token the user sends with his requests | |
var decoded = jwt.decode(token, tokenSecret); | |
//TODO: must check the token expiry and ensure the token is still valid |
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
/* | |
* Taken from https://github.com/ghiden/angucomplete-alt/blob/master/angucomplete-alt.js | |
*/ | |
function findMatchString(target, str) { | |
var result, matches, re; | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions | |
// Escape user input to be treated as a literal string within a regular expression | |
re = new RegExp(str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'i'); | |
if (!target) { return; } | |
matches = target.match(re); |
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
Run | |
ssh-add -K ~/.ssh/privateKey | |
It'll prompt for your passphrase if necessary, then add it to your Keychain. |
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
jenkins: | |
build: ./jenkins/ | |
ports: | |
- 8080:8080 | |
container_name: jenkins | |
php: | |
build: ./php/ | |
volumes_from: |
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
#!/bin/sh | |
exec < /dev/tty | |
./.git/hooks/commit-msg.py $1 |
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
--- | |
- hosts: all | |
vars: | |
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx' | |
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx' | |
UBUNTU_COMMON_LOGWATCH_EMAIL: [email protected] | |
ubuntu_common_deploy_user_name: deploy | |
ubuntu_common_deploy_public_keys: | |
- ~/.ssh/id_rsa.pub |
OlderNewer