Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / emacs-inline.patch
Created December 27, 2013 04:23
Emacs.appでインラインパッチを当てた時にdistnotedが暴走しなくなる。
diff -r -N -p -x '*.elc' ../emacs-24.3.org/lisp/term/common-win.el lisp/term/common-win.el
*** ../emacs-24.3.org/lisp/term/common-win.el 2013-01-02 05:37:17.000000000 +0900
--- lisp/term/common-win.el 2013-04-13 21:49:53.000000000 +0900
*************** is not used)."
*** 127,132 ****
--- 127,133 ----
(cons (logior (lsh 0 16) 12) 'ns-new-frame)
(cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar)
(cons (logior (lsh 0 16) 14) 'ns-show-prefs)
+ (cons (logior (lsh 0 16) 15) 'mac-change-input-method)
@alecthomas
alecthomas / gist:4497119
Created January 9, 2013 21:28
*Very* hacky YAML + Salt structure validation.
import itertools
import functools
import fnmatch
import os
from StringIO import StringIO
import yaml
from yaml.parser import ParserError
import voluptuous as V
@tsuna
tsuna / count_hbase.sh
Created November 17, 2011 18:42
Script to get stats on the number of KeyValue and size of an HBase table, directly from HFiles
#!/bin/bash
# Copyright (c) 2010, 2011 Benoit Sigoure. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
@mm53bar
mm53bar / deploy.rb
Created October 7, 2011 21:05
My capistrano deployment
require File.join(File.dirname(__FILE__), 'deploy/nginx')
require File.join(File.dirname(__FILE__), 'deploy/log')
default_run_options[:pty] = true
set :ssh_options, { :forward_agent => true }
set :application, "appname"
set :repository, "git@giturl"
set :scm, :git
@nukemberg
nukemberg / knife.sh
Created June 28, 2011 07:51 — forked from ches/knife
bash completion for Chef's knife command (updated for 0.10)
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
@pborreli
pborreli / Configuration.class.php
Created April 28, 2010 17:01
adding ":" to all labels and "*" to all required fields inside symfony 1.3+ forms
<?php
class privateConfiguration extends sfApplicationConfiguration
{
public function configure()
{
$this->dispatcher->connect('form.post_configure', array($this, 'listenToFormPostConfigure'));
}
/**
@mrrooijen
mrrooijen / Capistrano-Deployment-Recipe.rb
Created July 29, 2009 09:34
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@mattfawcett
mattfawcett / gist:72340
Created March 1, 2009 14:22
Sync your development database and file upload folders with whatever your staging/production server currently has
# Task has the following dependencies
# net/ssh gem [gem install net-ssh]
# net/sftp gem [gem install net-sftp]
# rsync command line utility
# yamb_db rails plugin [ruby script/plugin install git://github.com/adamwiggins/yaml_db.git]
desc "This task will make your development environment download and import a fresh copy of your staging database and also sync any folders such as image uploads so you can quickly replicate your staging/production server content locally"
task :sync_with_staging => :environment do
@remote_host = 'yourremoteserver.com'
@remote_user = 'yoursshuser'