🏋️♂️
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
namespace :deploy do | |
after :publishing, :restart do | |
on roles(:app) do | |
within release_path do | |
execute :sudo, "cp -f #{release_path}/my_config.conf /etc/init/" | |
execute :sudo, 'initctl restart my_service' | |
end | |
end | |
end | |
end |
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/bash | |
echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)" | |
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 | |
echo "Enable subpixel font rendering on non-Apple LCDs" | |
defaults write NSGlobalDomain AppleFontSmoothing -int 2 | |
echo "Enable the 2D Dock" | |
defaults write com.apple.dock no-glass -bool true |
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
Httpconnection connection = null; | |
BufferedReader reader = null; | |
String forecastJsonStr = null; | |
try { | |
URL url = new URL("http://api.openweathermap.org/data/2.5/forecast/daily?q=94043&mode=json&units=metric&cnt=7"); | |
connection = (Httpconnection) url.openConnection(); | |
connection.setRequestMethod("GET"); | |
connection.connect(); | |
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
(env) -> | |
if env.ENV is 'production' | |
{ | |
API_ENDPOINT: '' | |
FACEBOOK_ID: '' | |
FACEBOOK_NAMESPACE: '' | |
FACEBOOK_OBJECT: '' | |
} | |
else | |
{ |
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
root = 'public' | |
use Rack::Static, | |
urls: Dir["#{root}/*"].map { |file| file.sub(root, '')}, | |
root: root, | |
index: 'index.html', | |
header_rules: [[:all, { 'Cache-Control' => 'public, max-age=3600' }]] | |
run -> env { | |
[ |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'ostruct' | |
class CookbookCreator | |
COMPANY_NAME = 'COMPANY_NAME' | |
EMAIL = '[email protected]' | |
COOKBOOK_NAME = 'COOKBOOK_NAME' | |
class << self |
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 isPrime(number: Int) = (2 until number) forall (divider => number % divider != 0) |
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
document.querySelector("a").addEventListener("mousedown", function(e) { | |
if (e.which === 2) { | |
this.style.pointerEvents = "none"; | |
} | |
}); | |
document.body.addEventListener("mouseup", function(e) { | |
if (e.which === 2) { | |
document.querySelector("a").style.pointerEvents = ""; | |
} |
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
// Boring | |
if (success) { | |
obj.start(); | |
} else { | |
obj.stop(); | |
} | |
// Hipster-fun | |
var method = (success ? 'start' : 'stop'); | |
obj[method](); |
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
Extensions = angular.module 'MyApplication.ExtensionsModule', [] | |
# ... | |
Extensions.factory '$templateCache', [ | |
'$cacheFactory', '$http', '$injector', 'SecurityConstants', | |
($cacheFactory, $http, $injector, SecurityConstants) -> | |
cache = $cacheFactory('templates') | |
promise = undefined | |