Skip to content

Instantly share code, notes, and snippets.

@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
@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
@absoutherland-zz
absoutherland-zz / dashboard
Created November 19, 2013 23:00
init script for Dashing
#!/bin/bash
# chkconfig: 2345 55 25
# Dashing service
# Add this file to /etc/init.d/
# Make executable
# Configure chkconfig
# Dashboard will start at boot. Check out the boot log for trouble shooting "/var/log/boot.log"
######################################################
#YOU WILL NEED TO CONFIGURE THIS FOR YOUR ENVIRONMENT#
######################################################
@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.
@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:
@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
*
@erans
erans / mongobackup.sh
Last active October 7, 2019 16:59
MongoDB ReplicaSet Backup Script on Google Compute Engine and Google Cloud Storage
# Path to boto config file, needed by gsutils
BOTO_CONFIG="/etc/boto.cfg"
# Path in which to create the backup (will get cleaned later)
BACKUP_PATH="/mnt/data/dump/"
# DB name
DB_NAME="mydatabase"
# Google Cloud Storage Bucket Name
@TechnologistAU
TechnologistAU / unifi.sh
Last active October 10, 2019 02:57
UniFi 5 Installation Script for Raspberry Pi
#!/bin/bash
################################################################################
#
# This script automates the installation of the UniFi controller software on the
# Raspberry Pi.
#
# http://www.technologist.site/ubnt
#
################################################################################
@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
@joshukraine
joshukraine / how-to-install-powerline-on-osx.md
Last active August 10, 2020 03:04
How to Install Powerline on OS X

How to Install Powerline on OS X

Preface

This whole thing hinges on having the right version of Python installed. We're going to do it via Homebrew. You have to install Python BEFORE you install Vim. So if Vim is already installed (the Homebrew version, that is) then remove it first.

Installation

Check to see if vim or python are installed.

brew list