Skip to content

Instantly share code, notes, and snippets.

View sideshowcoder's full-sized avatar
💭
🐱

Philipp Fehre sideshowcoder

💭
🐱
View GitHub Profile
@burtlo
burtlo / .bash_profile
Last active October 3, 2015 18:18
Github pull request from the command-line
function pull-request {
hub pull-request -h $(__github_remote_origin):$(__github_current_branch)
}
function __github_remote_origin {
# Finds the origin on github if it is https or git
echo "$1`git remote -v | grep -e "^origin.* (push)" | sed "s#origin[[:blank:]]https://github.com/\([^/]*\)\/.*#\1#" | sed "s#origin.*:\([^/]*\).*push.*#\1#"`"
}
function __github_current_branch {
@benders
benders / README
Created July 4, 2012 01:17
Using Vagrant and puppet-rbenv
yourproject/
- Vagrantfile
- manifests/
- centos62-64.pp
- modules/
- rbenv/ <-- git submodule of https://github.com/alup/puppet-rbenv
@simonwelsh
simonwelsh / bot.php
Last active December 17, 2015 05:38
A bot for App.net that monitors its PMs and replies with a link to a "I'm feeling lucky" search for the text.
<?php
/**
* A bot for App.net that monitors its PMs and replies with a link to a
* "I'm feeling lucky" search for the text.
*
* @author Simon Welsh (@simon_w)
* @license WTFPL Version 2 (http://www.wtfpl.net/txt/copying/)
*/
require_once dirname(__FILE__) . '/AppDotNet.php';
@netmute
netmute / Molokai.itermcolors
Created December 2, 2011 16:44
iTerm Molokai Colorscheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.48771023750305176</real>
<key>Green Component</key>
<real>0.48781105875968933</real>
@ericbmerritt
ericbmerritt / dialyzer.mkf
Created September 2, 2012 14:59
Dialyzer Example Makefile
# -*- mode: Makefile; fill-column: 80; comment-column: 75; -*-
ERL = $(shell which erl)
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin
REBAR=$(shell which rebar)
ifeq ($(REBAR),)
$(error "Rebar not available on this system")
@codahale
codahale / SetBenchmark.java
Created April 3, 2013 18:49
An example of how to use Caliper: http://code.google.com/p/caliper/.
import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
import java.util.HashSet;
import java.util.TreeSet;
public class SetBenchmark extends SimpleBenchmark {
// If you add a main function, you can run it from your IDE.
public static void main(String[] args) throws Exception {
new Runner().run(
require 'fiddle'
class GVL
handle = Fiddle::Handle::DEFAULT
address = handle['rb_thread_blocking_region']
func = Fiddle::Function.new address, [Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP,
Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOIDP
@scalabl3
scalabl3 / gist:8046965
Last active September 26, 2019 12:09
Install Elasticsearch 90.5 for Couchbase Integration on Mac via homebrew
These instructions are on Mac OS X, but it can easily be translated for any linux os too. The only differences will be to use default in elasticsearch.yml for vbuckets of 1024 (comment or take that line out). Also the paths to plugins, config, bin, etc. might be different as far as copying the couchbase_template.json over to config/templates.

On Mac I highly recommend just permanently increasing the max number of file descriptors allowed (unlimited is no longer a valid parameter):

$ cd /etc
$ vi launchd.conf
$ limit maxfiles 1000000 1000000
@jbtule
jbtule / build.fsx
Last active March 24, 2020 16:06
Crossplatform FSharp Makefile Bootstrapper
#!/bin/sh
#if run_with_bin_sh
# Doing this because arguments can't be used with /usr/bin/env on linux, just mac
exec fsharpi --define:mono_posix --exec $0 $*
#endif
(*
* Crossplatform FSharp Makefile Bootstrapper
* Apache licensed - Copyright 2014 Jay Tuley <jay+code@tuley.name>
* v 2.0 https://gist.github.com/jbtule/9243729