Skip to content

Instantly share code, notes, and snippets.

@nono
nono / redis2txt.rb
Created November 28, 2011 23:29
Export data from redis to a plain text files
#!/usr/bin/env ruby
require "redis"
redis = Redis.new
redis.keys("*").each do |key|
val = case redis.type(key)
when "string"
redis.get key
when "list"
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 10, 2024 03:45
A badass list of frontend development resources I collected over time.
@linjunpop
linjunpop / deploy-rails-4-app-with-dokku-on-digital-ocean.md
Last active September 11, 2024 10:21
Deploy Rails 4 app with Dokku on DigitalOcean

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@vincentbernat
vincentbernat / elasticsearch.erl
Created November 30, 2013 07:50
Erlang module for Tsung to extract data from large files
-module(elasticsearch).
-export([autocomplete/1, autocomplete/0,
search/1, search/0,
start/0,
stop/0,
loop/1]).
-on_load(start/0).
%% Return an autocomplete request
autocomplete() ->
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@cabal95
cabal95 / vm-backup.sh
Created July 25, 2015 17:53
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@fxn
fxn / init.coffee
Created January 31, 2016 10:59
Easy pipeline entry in Atom (Elixir)
# ~/.atom/init.coffee
atom.commands.add 'atom-text-editor', 'elixir:pipeline': ->
editor = atom.workspace.getActiveTextEditor()
editor.moveToEndOfLine()
editor.insertNewline()
editor.insertText("|> ")
@tkrajina
tkrajina / unmarshal_interface.go
Last active October 29, 2024 03:30
Unmarshal JSON to specific interface implementation
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type Something interface{}
@phansch
phansch / yardoc_cheatsheet.md
Last active September 22, 2024 02:17 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet