Skip to content

Instantly share code, notes, and snippets.

View msonnabaum's full-sized avatar

Mark Sonnabaum msonnabaum

  • Lithic
  • San Diego, CA
View GitHub Profile
@winhamwr
winhamwr / hudson fabric deploy bash script
Created January 5, 2010 17:49
bash script for use by a hudson job to deploy a project via fabric
#!/bin/bash
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
PARENT_JOB=pstat_master_unittest
KEY_PATH=$HOME/policystat/fabric/pstat_dev.key
if [ ! -z "$WORKSPACE" ]; then
WORKSPACE=/vol/fs/var/lib/hudson/home/jobs/pstat_master_deploy/workspace
fi
var performance = (function () {
var my = {};
// Wrap a function body in this to return a copy that instruments itself
// If you want this to be useful, you should give your profiled function a name,
// otherwise it will be identified as "", which is less than useful.
my.profile = function (func) {
return function () {
var start = new Date().getTime(),
time,
#!/bin/bash
apt-get update
apt-get install -y ruby ruby-dev rubygems libopenssl-ruby
echo "gem: --bindir /usr/local/bin" >> ~/.gemrc
gem install chef
@rtomayko
rtomayko / optparse-template.rb
Last active June 3, 2023 03:16
Ruby optparse template
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
@christianchristensen
christianchristensen / .gitignore
Created November 21, 2011 17:43
Git ignore file for committing hudson/jenkins configs to version control.
*.log
jobs/*/workspace
jobs/*/builds
jobs/*/lastStable
jobs/*/lastSuccessful
jobs/*/nextBuildNumber
updates
.owner
<?php
// media_gallery.module
function media_gallery_menu() {
$items['media-gallery/detail/%node/%file'] = array(
'page callback' => 'media_gallery_detail_page',
'page arguments' => array(2, 3),
'access callback' => 'node_access',
'access arguments' => array('view', 2),
#!/usr/bin/env ruby
require 'yaml'
contributors = Hash.new(0)
%x[git log 8.x --since=2011-03-09 -s --format=%s].split("\n").each do |m|
m.scan(/\s(?:by\s?)([\w\s,.|]+):/i).each do |people|
people[0].split(/[,|]/).each do |p|
p.strip!
contributors[p] += 1 unless p.nil?
end
<?php
foreach (array_keys(views_get_all_views()) as $view) {
$view = views_get_view($view);
$view->display['default']->display_options['cache'] = array('type' => time, 'results_lifespan' => -1, 'output_lifespan' => 1800);
$view->save();
}

Install XHProf

Pear

pear upgrade PEAR
pecl install xhprof-0.9.2

MAMP

@karmi
karmi / .gitignore
Last active August 24, 2020 09:25
Elasticat makes Elasticsearch JSON responses pretty • http://git.io/elasticat
.DS_Store
tmp/