Skip to content

Instantly share code, notes, and snippets.

View sheenobu's full-sized avatar
🙃
smug

Sheena Artrip sheenobu

🙃
smug
View GitHub Profile
@danmackinlay
danmackinlay / supervisord.sh
Created August 27, 2009 07:07
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@jpertino
jpertino / simpleJettyServer.groovy
Created January 20, 2011 04:29
a simple embedded jetty server
@Grab('org.mortbay.jetty:jetty-embedded:6.1.26')
import static org.mortbay.jetty.Handler.DEFAULT
import org.mortbay.jetty.Server
import org.mortbay.jetty.servlet.Context
import org.mortbay.jetty.servlet.DefaultServlet
import org.mortbay.servlet.MultiPartFilter
import groovy.servlet.GroovyServlet
import groovy.servlet.TemplateServlet
@steadicat
steadicat / proxy.js
Created March 29, 2011 18:46
A reverse-proxy for CouchDB written in Node.js
#!/usr/local/bin/node
var sys = require('sys');
var http = require('http');
var url = require('url');
var PREFIX = '/db/';
var TARGET = 'http://example.cloudant.com';
var PORT = 8001;
package my.elasticsearch;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@noomerikal
noomerikal / api.rb
Created February 20, 2012 06:55
kodagraph api
require 'sinatra'
require 'mongoid'
require 'json'
require 'jsonp'
require 'rack/throttle'
require 'dalli'
set :cache, Dalli::Client.new("localhost:11211")
set :short_ttl, 400
set :long_ttl, 4600
@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 = [email protected]: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:

@chetanmeh
chetanmeh / logging-example.txt
Created August 19, 2012 13:38
Pax runner example demonstrating Logging
#This is a Pax Runner config file which uses Felix ConfigAdmin, Pax Logging and other bundles to
#demonstrate how to configure pax logging.
#It uses File install bundle and configures it to watch the config folder. We would add org.ops4j.pax.logging.cfg
#file to this folder which would then be picked by File install and thus update Pax logging config
--platform=felix
--vmOptions=-Dorg.osgi.service.http.port=9090 \
-Dfelix.fileinstall.dir=../config
#List of profiles to run
@bminer
bminer / changeTypeAttr.js
Created August 31, 2012 21:30
Cross-browser solution for changing the 'type' attribute of an `<input/>` tag.
/* x is the <input/> element
type is the type you want to change it to.
jQuery is required and assumed to be the "$" variable */
function changeType(x, type) {
if(x.prop('type') == type)
return x; //That was easy.
try {
return x.prop('type', type); //Stupid IE security will not allow this
} catch(e) {
//Try re-creating the element (yep... this sucks)
@dsdstudio
dsdstudio / ipojo.gradle
Last active October 1, 2018 16:39
gradle -> felix-ipojo bytecode manipulation
apply plugin: "osgi"
apply plugin: "java"
apply plugin: "maven"
version = "0.0.1"
buildscript {
repositories {
mavenCentral()
}
@trinitronx
trinitronx / truecrypt_fix.bash
Last active September 27, 2024 11:03 — forked from jimjh/truecrypt_fix.bash
Fixes annoying brew doctor messages caused by Truecrypt
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )