Skip to content

Instantly share code, notes, and snippets.

View grauwoelfchen's full-sized avatar
🐺
Typing with carved wooden keyboard ᕕ( ᐛ )ᕗ

Yasha grauwoelfchen

🐺
Typing with carved wooden keyboard ᕕ( ᐛ )ᕗ
View GitHub Profile
@exoer
exoer / db_server.rb
Created July 4, 2011 17:58 — forked from coderanger/db_server.rb
Create postgres users and databases from Chef
include_recipe "postgresql::server90"
# inspiration from
# https://gist.github.com/637579
execute "create-root-user" do
code = <<-EOH
psql -U postgres -c "select * from pg_user where usename='root'" | grep -c root
EOH
command "createuser -U postgres -s root"
@alkema
alkema / deploy.rb
Created July 9, 2011 20:01
Capistrano task for a Node.js app with github Forever and NPM.
set :application, "appname"
set :deploy_to, "/var/www"
set :scm, :git
set :repository, "git@github.com:user/app.git"
default_run_options[:pty] = true
set :user, "www-data"
set :domain, "foo.tld"
set :normalize_asset_timestamps, false
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@yonchu
yonchu / color256.sh
Created October 18, 2012 19:10
zsh/bashで256色のカラーパレットを表示
#!/bin/sh
#
# 256色のカラーパレットを表示する
# bash と zsh にて実行可能
#
target_shell=$1
if [ -z "$1" ]; then
target_shell=$(basename "$SHELL")

Webmachine を使ったホットスワップ

更新:2013-02-22
バージョン:0.0.4
作者:@voluntas
URL:http://voluntas.github.com/

一度もサーバは落としてません

@jj1bdx
jj1bdx / p3.erl
Last active March 11, 2016 19:05
Prime number generator with lazy evaluation in Erlang: See http://erlang.org/pipermail/erlang-questions/1999-March/000176.html
%%% Prime number sieve code with lazy evaluation by Joe Armstrong
%%% (very slightly modified for syntax check)
%%% http://erlang.org/pipermail/erlang-questions/1999-March/000176.html
-module(p3).
-export([from/1,filter/2,sift/2,sieve/1,primes/0, first/1]).
%% This generates a lazy sequence starting from K.
%% from(K) ->
@essen
essen / my_module.erl
Created October 14, 2013 03:25
Thinking in Erlang: The Code
-module(my_module).
-export([my_function/1, my_function/2]).
-export([infinite_loop/0, f/1, r/2, sort/1]).
-export([only_primes/1, is_prime/1]).
my_function(A) when is_integer(A) ->
my_function(A, 0);
my_function(A) when is_list(A) ->
my_function(list_to_integer(A), 0).
@miguelmota
miguelmota / README.md
Last active May 25, 2024 13:23
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@kakutani
kakutani / Annotation.md
Last active September 26, 2019 13:35 — forked from ursm/Gemfile
Raw Gemfile on Idobata (master - 5adeddb)

Idobata Gemfile プレゼント

tl;dr IdotabaのGemfileは"全プレ"になりました。ご笑納ください。→ Gemfile

プレゼントについてのお詫び

rebuild.fmのep36でお知らせさせていただきました、Idobataの最新版Gemfileプレゼントをお届けいたします。 過日はIdobata会議01への多数のご参加ありがとうございました。おかげさまで盛況なミートアップとなりました。 (当日会場を提供いただいたEngine Yardさまのブログにて、Idobata会議01当日の様子がまとめられています。ありがとうございます!)