Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
seq 0 10 | {
declare -i sum
while read num ; do
let sum+=$num
done
# bash => 55 (^^)v
# zsh => 55
@tarot
tarot / package.json
Last active August 29, 2015 14:12 — forked from yusuke8609/package.json
{
"name": "retrieve_folders",
"dependencies": {
"bluebird": "^2.4.2",
"dotenv": "^0.4.0",
"jsforce": "^1.3.1",
"underscore": "^1.7.0",
"unzip": "^0.1.11"
}
}
# Search shell history with peco: https://github.com/peco/peco
# Adapted from: https://github.com/mooz/percol#zsh-history-search
if which peco &> /dev/null; then
function peco_select_history() {
local tac=$( \
(which gtac &> /dev/null && echo -n "gtac") || \
(which tac &> /dev/null && echo -n "tac") || \
echo -n "tail -r" \
)
BUFFER=$(fc -l -n 1 | eval $tac | \
@tarot
tarot / README.md
Created July 4, 2016 07:20 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh