git config --global alias.remove-merged-branches '!git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'
```sh
This file contains 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
#!/usr/bin/env ruby | |
# | |
# NIEC BENCHMARKER: | |
# | |
# == Usage | |
# | |
# 1. Create a ruby source file containing methods with arbitrary names. | |
# Those are the methods that will be benchmarked. | |
# For example, contents of my-benchmarks.rb: | |
# |
This file contains 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
const cachedReadFile = (function() { | |
const cache = new Map(); | |
return (p) => { | |
if (cache.has(p)) return Promise.resolve(cache.get(p)); | |
else return readFile(p).tap((file) => cache.set(p, file)); | |
} | |
}()); |
This file contains 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
- content_for(:inner_content) do | |
= render :partial => "inner_content" | |
- if some_condition | |
%outertag1= yield :inner_content | |
- else | |
%outertag2= yield :inner_content |
This file contains 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 | |
set -x verbose #echo on | |
coffee --bare -c */**.coffee | |
rsync --delete-excluded \ | |
--exclude '.git*' \ | |
--exclude 'deploy.sh' \ | |
--exclude '*.coffee' \ | |
-va $(pwd) ~/Dropbox/Public |
This file contains 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
; 1. Stage the changes you want to have amended to the earlier commit | |
; 2. `$ git fix <revision>` (e.g. `git fix HEAD~4`or `git fix bbfba98`) | |
[alias] | |
fix = "!_() { c=$(git rev-parse $1) && git commit --fixup $c && if grep -qv \"No local changes\" <<<$(git stash); then s=1; fi; git -c core.editor=cat rebase -i --autosquash $c~; if [[ -n "$s" ]]; then git stash pop; fi; }; _" |
This file contains 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
#!/usr/bin/env ruby | |
require 'socket' | |
# This script runs every minute, captures stats about redis | |
# and forwards them to graphite as counter values. | |
# Graphite/carbon settings | |
GRAPHITE_HOST="graphite.intra.local.ch" | |
GRAPHITE_PORT=8125 |
This file contains 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
--EVAL "this script" 1 key_name new_item max_size | |
local key = KEYS[1]; | |
local item, max = unpack(ARGV); | |
redis.call('RPUSH', key, item); | |
redis.call('LTRIM', key, -max, -1); |
OlderNewer