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
namespace :secret do | |
desc "Edit an encrypted data bag item in EDITOR" | |
task :edit, :item do |t, args| | |
unless ENV['EDITOR'] | |
puts "No EDITOR found. Try:" | |
puts "export EDITOR=vim" | |
exit 1 | |
end | |
abort 'usage: rake "secret:edit[<item name>]"' unless args.item |
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/sh | |
VERSION=0.8.6 | |
PLATFORM=darwin | |
ARCH=x64 | |
PREFIX="$HOME/node-v$VERSION-$PLATFORM-$ARCH" | |
mkdir -p "$PREFIX" && \ | |
curl http://nodejs.org/dist/v$VERSION/node-v$VERSION-$PLATFORM-$ARCH.tar.gz \ | |
| tar xzvf - --strip-components=1 -C "$PREFIX" |
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
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
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
Vagrant::Config.run do |config| | |
# ... | |
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
end |
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
import groovyx.net.http.* | |
@Grab(group='org.codehaus.groovy.modules.http-builder', | |
module='http-builder', version='0.5.1' ) | |
def http = new HTTPBuilder( 'http://search.twitter.com/' ) | |
def tweets = 'tweets' | |
def search = {String s -> [about: {String s2 -> | |
http.get( path: 'search.json', | |
query: [q:s2] ) { resp, json -> | |
json.results.each { |
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
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
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
controller.metaClass.render = {Map map, Closure closure -> | |
renderArgs.putAll(map) | |
switch(map.contentType) { | |
case null: | |
break | |
case 'application/xml': | |
case 'text/xml': | |
def smb = new StreamingMarkupBuilder() | |
if (map.encoding){ |
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
import java.lang.management.ManagementFactory | |
includeTargets << grailsScript("_GrailsPackage") | |
includeTargets << grailsScript("_GrailsRun") | |
target(main: "Launches an app and automatically launches JConsole") { | |
//depends(compile, classpath, runApp) | |
depends(checkVersion, configureProxy, packageApp, parseArguments) | |
if (argsMap.https) { | |
runAppHttps() |
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
sudo add-apt-repository ppa:groovy-dev/grails | |
sudo apt-get update | |
sudo apt-get install grails-ppa | |
#to add grails 2.0.x | |
sudo apt-get install grails 2.0.x | |
#to add grails 1.3.9 | |
sudo apt-get install grails-1.3.9 |
NewerOlder