Skip to content

Instantly share code, notes, and snippets.

@nidico
nidico / issue-migrate-bitbucket-to-github.py
Created September 24, 2012 21:00
Helper script for issue migration from Bitbucket to GitHub
#!/usr/bin/env python
"""
This script helps migrating issues from Bitbucket to GitHub.
It currently ignores milestones completly and doesn't care whether an issue is
open, new or on hold. As long as it's not closed it's considered open.
To use it, install python-bitbucket, PyGithub and ipdb.
@me-vlad
me-vlad / thin.sh
Created March 18, 2012 03:41
init script for multiple thin instances with rbenv shared install
#!/bin/sh
# thin This shell script takes care of starting and stopping
# thin daemon from rbenv shared install
#
# chkconfig: 2345 85 15
# description: thin is an Ruby web server
# config: /etc/sysconfig/thin
### BEGIN INIT INFO
@marcoleong
marcoleong / bootstrap-scrollspy-horizontal.js
Created February 27, 2012 09:22
Modified bootstrap-scrollspy.js to support horizontal scroll.
/* =============================================================
* bootstrap-scrollspy.js v2.0.1
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@slayer
slayer / rbenv-install-system-wide.sh
Created December 23, 2011 11:17
rbenv install and system wide install on Ubuntu to /opt/rbenv
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /opt/rbenv
# Add rbenv to the path:
@rubiojr
rubiojr / rbvmomi_example1.rb
Created September 5, 2011 15:28
Ruby VMWare VSphere API Example 1 (rbvmomi)
require 'rubygems'
require 'rbvmomi'
require 'pp'
require 'alchemist'
hyper = 'thunder03'
vim = RbVmomi::VIM.connect :host => hyper, :user => 'root', :password => 'secret', :insecure => true
#
# get current time
@jnunemaker
jnunemaker / gist:217362
Created October 24, 2009 04:07 — forked from lukesutton/gist:107966
example of warden with sinatra
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
env['REQUEST_METHOD'] = "POST"
end