Skip to content

Instantly share code, notes, and snippets.

// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
// Code
Function.prototype.curry = function() {
var func = this, a = Array.prototype.slice.call(arguments, 0);
return function() {
var a_len = a.length, length = arguments.length;
while (length--) a[a_len + length] = arguments[length];
return func.apply(this, a);
}
};
@lfender6445
lfender6445 / gist:9919357
Last active July 25, 2024 02:05
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@larsxschneider
larsxschneider / enc4hub.sh
Created June 3, 2020 06:31
Encrypt a file to send it securely to another Hubber
#!/usr/bin/env bash
# Encrypt a file to send it securely to another Hubber
#
# Use https://gpgtools.org/ to an easy to use decryption UI.
#
# Usage:
# enc4hub larsxschneider /path/to/file
#
set -e
recipient=$1