Skip to content

Instantly share code, notes, and snippets.

View jeremyckahn's full-sized avatar

Jeremy Kahn jeremyckahn

View GitHub Profile
@adparadise
adparadise / grunt.js
Created November 2, 2012 23:19
Grunt custom task
module.exports = function(grunt) {
function custom () {
console.log(this.data.variable);
};
grunt.initConfig({
custom: {
dist: {
variable: 'value'
}
@zph
zph / .zshrc
Created February 10, 2013 02:59
autoload -z edit-command-line
zle -N edit-command-line
bindkey "^X^E" edit-command-line
@lukearmstrong
lukearmstrong / install-ruby.sh
Last active June 19, 2017 10:11
Install enough to get Ruby and Sass working on RHEL/CentOS
# lol redhat
su
# Install deps
yum install libyaml libyaml-devel openssl libxml2-devel bison libxslt-devel openssl-devel tcl tk libffi tcl-devel tk-devel libffi-devel
# Download Ruby
cd /usr/local/src/
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar -xvzf ruby-1.9.3-p392.tar.gz

Demo

How to install

  1. Get fzf
  2. Install all-the-package-names globally: npm i -g all-the-package-names
  3. Add the following alias to your .bashrc: alias npmi = 'all-the-package-names | fzf | xargs npm install'

How to use

Just use npmi instead of npm i <package-name>. All options work (--save, -g etc).

@ejdyksen
ejdyksen / mini-console.html
Last active September 18, 2017 22:13
A tool for getting at a JS console when there is none available.
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div>
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" />
<script type="text/javascript">
var appendConsole = function(message, type) {
var color = "black";
if (type === "error") {
color = "red";
} else if (type === "debug") {
@kugaevsky
kugaevsky / revert.sh
Last active July 4, 2018 09:06
Reverting back to node 0.10.36 on Mac OS X with Homebrew
$ cd /usr/local
$ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb
$ brew unlink node
$ brew install node
$ npm install -g npm@latest
@deadlocked247
deadlocked247 / Trie.js
Last active October 4, 2019 14:06
Trie implementation in ES6, good for string autocomplete
/* Class representing a Trie data structure */
export default class Trie {
/**
* Creates a Trie
* @return {Object} Trie
*/
constructor() {
this.words = 0;
this.prefixes = 0;
@wookiecooking
wookiecooking / aliases.sh
Created November 30, 2013 00:52
[Shell] Assortment of OSX influenced bash aliases and functions
# Rails Stuff
alias stoprails='kill -9 $(lsof -i :3000 -t)'
alias startrails='rails server -d'
alias restartrails='stopRails && startRails'
#Check PHP For Erroes
alias phpcheck='find ./ -name \*.php | xargs -n 1 php -l'
# ROT13-encode text. Works for decoding, too! ;)
alias rot13='tr a-zA-Z n-za-mN-ZA-M'
@marcel
marcel / gist:2100703
Created March 19, 2012 07:24
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@jeremyckahn
jeremyckahn / inherit-by-proxy.js
Created May 10, 2013 04:25
Proxy-based inheritance pattern in JavaScript.
function inherit (child, parent) {
function proxy () {};
proxy.prototype = parent.prototype;
child.prototype = new proxy();
};
function Parent () {}
function Child () {}
inherit(Child, Parent);