Create and store a 512-byte random encryption key named secret
:
$ mkkey secret
Encrypt the contents of file
with the secret
key and write it to file.enc
:
$ encrypt secret < file > file.enc
var detectBackOrForward = function(onBack, onForward) { | |
hashHistory = [window.location.hash]; | |
historyLength = window.history.length; | |
return function() { | |
var hash = window.location.hash, length = window.history.length; | |
if (hashHistory.length && historyLength == length) { | |
if (hashHistory[hashHistory.length - 2] == hash) { | |
hashHistory = hashHistory.slice(0, -1); | |
onBack(); |
#!/usr/bin/env bash | |
# | |
# Wraps curl with a custom-drawn progress bar. Use it just like curl: | |
# | |
# $ curl-progress -O http://example.com/file.tar.gz | |
# $ curl-progress http://example.com/file.tar.gz > file.tar.gz | |
# | |
# All arguments to the program are passed directly to curl. Define your | |
# custom progress bar in the `print_progress` function. | |
# |
# Clone rbenv into ~/.rbenv | |
git clone git@github.com:sstephenson/rbenv.git ~/.rbenv | |
# Add rbenv to your PATH | |
# NOTE: rbenv is *NOT* compatible with rvm, so you'll need to | |
# remove rvm from your profile if it's present. (This is because | |
# rvm overrides the `gem` command.) | |
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile | |
exec $SHELL |
#!/usr/bin/env TEST=1 tclsh | |
# Lexical scoping in Tcl | |
proc let {block args} { | |
try { | |
set captured_vars [uplevel [list capture [block args]]] | |
set all_var_names [uplevel {info vars}] | |
foreach var [block args] value $args { | |
uplevel [list catch [list unset $var]] |
# RubyGems has this functionality built-in. Just specify | |
# the particular version you want to use as the first argument | |
# of the command, surrounded by underscores. | |
$ gem install rails --version 3.0.9 | |
... | |
$ gem install rails --pre | |
... | |
$ rbenv rehash | |
$ rails --version |
From: Sam Stephenson <sstephenson@gmail.com> | |
Subject: Re: ruby-build hint | |
Date: Sun, 10 Feb 2013 12:25:56 -0600 | |
To: Michał Papis <mpapis@gmail.com> | |
Hi Michał, | |
Thanks for the email. | |
You're right that `[[` is not POSIX sh-compliant. Nor are the following |
#!/usr/bin/env coffee | |
class TestCase | |
@run: (print, callback) -> | |
tests = (new this testName for testName in @getTestNames()) | |
results = [] | |
passed = true | |
print "1..#{tests.length}" |
#!/usr/bin/env bash | |
# Reads lines from stdin in the format `VAR=value` and escapes | |
# them for the shell, prepending each line with `export`. | |
# Parameter substitution is allowed in `value` with `$VAR` and | |
# `${VAR}` syntax. You can escape `$` and `\` with a backslash. | |
sed \ | |
-e "/^[ "$'\t'"]*[A-Za-z_][0-9A-Za-z_]*=/ !d" \ | |
-e "s/'/'\\\\''/g" \ |