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 | |
wd=$PWD | |
pf="$wd/local" | |
get () { | |
local url=$1 | |
local md5=$2 | |
local name=$3 | |
[ "$(md5sum $name)" = "$md5 $name" ] || curl -L $url -o $name |
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
#Setup: | |
git pull git://github.com/sometimesfood/sandwich.git | |
cd sandwich | |
rake gem:build | |
bundle install --path=vendor/bundle | |
#These work: | |
echo 'file "/tmp/blubb" do content "blubb";end'|bundle exec sandwich | |
echo 'file "/tmp/blubb" do content ARGV.join;end'|bundle exec sandwich /dev/stdin bla blubb |
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
(defun extract-region-to-file (filename) | |
"Extract text in the region to a file" | |
(interactive "FExtract to file: ") | |
(save-excursion | |
(if buffer-read-only | |
(copy-region-as-kill (region-beginning) (region-end)) | |
(kill-region (region-beginning) (region-end))) | |
(find-file filename) | |
(end-of-buffer) | |
(unless (= (buffer-size) 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
# Add an apt repo from wright scripts. | |
# | |
# Example: | |
# | |
# AddAptRepo.new( | |
# self, | |
# name: 'docker', | |
# key_id: '36A1D7869245C8950F966E92D8576A8BA88D21E9', | |
# raw_line: "deb https://get.docker.com/ubuntu docker main" | |
# ).call |