Skip to content

Instantly share code, notes, and snippets.

View lukaszkorecki's full-sized avatar
🌴
🛹

Łukasz Korecki lukaszkorecki

🌴
🛹
View GitHub Profile
@tkirby
tkirby / gco.sh
Created November 15, 2012 11:09
Display menu of local git branches and allow to choose which to checkout by number.
#!/bin/bash
branches=()
eval "$(git for-each-ref --shell --format='branches+=(%(refname:short))' refs/heads/)"
# Set the prompt for the select command
PS3="Select a branch. 'q' to quit: "
select branch in "${branches[@]}"
do
@mriddle
mriddle / jenkins_copying_configuration.sh
Created November 9, 2012 03:13
Moving Jenkins server configuration from one server to another
ORIGINAL_JENKINS_SERVER=
ORIGINAL_SERVER_USER=
NEW_JENKINS_SERVER=
NEW_SERVER_USER=
# ON THE ORIGINAL JENKINS SERVER
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar
http://aol.streams.bassdrive.com:8012
http://www.bassjunkees.com/connect/connect.pls
http://dnbheaven.com/128kbps.m3u
http://207.200.96.227:8016/
http://www.drumnbasstv.com/128.m3u
http://www.di.fm/aacplus/itunes/drumandbass.pls
http://173.193.219.163:8545
@ku1ik
ku1ik / gist:3930651
Created October 22, 2012 09:38
You don't need bundle exec, rbenv-bundler and other bundler integration scripts

You don't need bundle exec, rbenv-bundler or other bundler integration scripts

You just need 2 things

Just prepend $PATH with .bundle/bin:

$ cat ~/.bashrc
...
export PATH=".bundle/bin:$PATH"

...

@andrzejsliwa
andrzejsliwa / post-receive.sh
Created October 14, 2012 15:57 — forked from stas/post-receive.sh
Heroku like deployment git hooks
#!/bin/bash
# (Re)spawn the application
function spawn () {
local ps_name=$1
local spawn_cmd=$2
local pids=`ps -C $ps_name -o pid=`
if [ ${#pids} -ne 0 ]
then
echo "Sending TERM to $pids..."
require 'benchmark/ips'
h = { foo: :bar }
Benchmark.ips do |r|
r.report('#[]') { h[:foo] }
r.report('#fetch') { h.fetch(:foo) }
end
###
# Scheme code is translated to YARV byte code, then evaluated in the
# Ruby Virtual Machine
require 'rbconfig'
require 'dl'
require 'fiddle'
require 'strscan'
class RubyVM
@txus
txus / let.rb
Created August 29, 2012 15:00
Kernel#let to the ruby core!!!
# Wouldn't you love this in Ruby? I would! :D
module Kernel
def let(bindings, &block)
block.call *bindings
end
end
msg = let [33, 'Lincoln'] do |age, name|
"I am #{name} and I am #{age} years old."
@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 +@

This document is intended to be a simplified version of the OAuth 2.0 specification. In particular it has been written with implementors in mind, and as such attempts to trim the spec down to just what you need to implement an OAuth provider or client. It is necessarily not complete, but attempts to introduce spec requirements in the same order in which the protocol proceeds in practise, with everything you need to know about each protocol endpoint brought together in one place rather than scattered across a large document.