Skip to content

Instantly share code, notes, and snippets.

View thcipriani's full-sized avatar

Tyler Cipriani thcipriani

View GitHub Profile
@mikesmullin
mikesmullin / recipe.rb
Created May 28, 2013 04:07
I found a situation when chef had generated Chef::Exceptions::CommandTimeout exception in git clone command if time of git clone is more than 600 seconds (10 minutes). Here's how to set the timeout value for such situations in chef recipe.
# monkey-patch Chef Git Provider
# to raise the default ShellOut timeout setting
# because this repo can take over 10min
# to clone from github.com
class ::Chef::Provider::Git
def clone # based on opscode/chef commit b86c5b06
converge_by("clone from #{@new_resource.repository} into #{@new_resource.destination}") do
remote = @new_resource.remote
args = []
@yiding
yiding / imapfilter_phabricator.lua
Created June 25, 2014 00:17
Imapfilter function to move all notifications related to phabricator notifications to a different folder
function pruneCommittedDiffs(mailbox, dest_mailbox)
diff_set = mailbox:contain_subject('[Differential]')
committed_diff_set = diff_set:contain_field('X-Phabricator-Mail-Tags', '<differential-committed>')
for _, message in ipairs(committed_diff_set) do
mmbox, uid = table.unpack(message)
rev_key = string.gsub(mmbox[uid]:fetch_field('In-Reply-To'), 'In%-Reply%-To: ', '')
all_diff_msgs = diff_set:contain_field('In-Reply-To', rev_key) + diff_set:contain_field('Message-ID', rev_key)
all_diff_msgs:move_messages(dest_mailbox)
end
end
@danguita
danguita / osx-development-setup.md
Last active June 2, 2016 13:37
Set up your shiny OSX for development
@altercation
altercation / xmonad.hs
Created January 10, 2017 03:02
XMonad Config for video bug report re: screenlock obscured by windows after switching displays
{-# LANGUAGE AllowAmbiguousTypes, DeriveDataTypeable, TypeSynonymInstances, MultiParamTypeClasses #-}
-- a little messy, I know, but it's WIP
---------------------------------------------------------------------------
-- Ethan Schoonover <es@ethanschoonover.com> @ethanschoonover --
-- https://github.com/altercation --
---------------------------------------------------------------------------
-- current as of XMonad 0.12
@joshenders
joshenders / sabnzbdplus.default
Last active December 8, 2017 19:50
Installing sabnzbdplus on Debian Wheezy from source
# This file is sourced by /etc/init.d/sabnzbdplus
#
# When SABnzbd+ is started using the init script, the
# --daemon option is always used, and the program is
# started under the account of $USER, as set below.
#
# Each setting is marked either "required" or "optional";
# leaving any required setting unconfigured will cause
# the service to not start.
@robacarp
robacarp / deep_thought.rb
Last active February 15, 2018 20:18
Testing ruby mutexs across threads and forks
# Deep Thought is a computer that was created by the pan-dimensional,
# hyper-intelligent species of beings (whose three-dimensional
# protrusions into our universe are ordinary white mice) to come up
# with the Answer to The Ultimate Question of Life, the Universe,
# and Everything. Deep Thought is the size of a small city.
class Worker
MUTEX = Mutex.new
@@mutex = Mutex.new
@joakin
joakin / README.md
Last active January 14, 2019 18:55
Collapse repeated unread notifications in phabricator
@rubiojr
rubiojr / quick_vm.rb
Created May 7, 2012 11:44
Quick OpenStack Server Create with ruby Fog
#!/usr/bin/env ruby
#
# Before we start, make sure you have Essex support in Fog
#
# Essex support has not been merged into upstream Fog so you'll need
# a custom ruby fog build to run through the examples
#
require 'fog'
require 'pp'
require 'highline/import'
@JeffreyWay
JeffreyWay / gist:3185773
Created July 27, 2012 02:01
PHP Installation Options
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
@gertvdijk
gertvdijk / init_and_start_gerrit.sh
Created July 27, 2018 11:13
Init and start Gerrit in a single shell script example
#!/bin/sh -ex
SITE_PATH="${HOME}/site"
GERRIT_WAR="/path/to/gerrit.war"
# Because Gerrit's "daemon --init" can't take init options we will do this
# separately. Feature request filed:
# https://bugs.chromium.org/p/gerrit/issues/detail?id=9004
# Init site (provision). Note that the GERRIT_WAR may be a different version