This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def wrapper(name): | |
| def wrap(f): | |
| def wrapped(*args, **kwargs): | |
| print name | |
| return f(*args, **kwargs) | |
| return wrapped | |
| return wrap | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | In VIM you can do one of the following: | |
| Comment all lines: :%s/^/# | |
| Comment lines 10 - 15: :10,15s/^/# | |
| Comment line 10 to current line: :10,.s/^/# | |
| Comment line 10 to end: :10,$s/^/# | |
| http://stackoverflow.com/questions/2276572/how-do-you-do-block-comment-in-yaml | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | vagrant@precise64:~$ cat ~/.tmux.conf | |
| # remap prefix to Control + a | |
| set -g prefix C-a | |
| # bind 'C-a C-a' to type 'C-a' | |
| bind C-a send-prefix | |
| unbind C-b | |
| # split into 3 panes | |
| new -s sesh -n blao | |
| select-window -t blao | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | t = start | |
| for value in values: | |
| timestr = str(t) | |
| if value is None: | |
| value = last | |
| else: | |
| last = value | |
| valuestr = "%f" % value | |
| datapoints = [timestr, valuestr] | |
| whisper.update(path2, valuestr, timestr) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env ruby | |
| require 'sinatra/async' | |
| require 'logger' | |
| require 'em-synchrony' | |
| require 'em-synchrony/mysql2' | |
| require 'em-synchrony/activerecord' | |
| $logger = Logger.new(File.join(File.dirname(__FILE__), "error.log")) | |
| ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "active_record.log")) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | [realms] | |
| DATACENTER1.DOMAIN.COM = { | |
| kdc = DOMAINCONTROLLER1.DATACENTER1.DOMAIN.COM | |
| admin_server = DOMAINCONTROLLER1.DATACENTER1.DOMAIN.COM | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | RedisSessionStore.logger = Rails.logger | |
| session_options = {:expire_after => 1.day, :key_prefix => 'sessions'} | |
| MultiSessionStore.stores[:plain] = [RedisSessionStore, session_options.merge(:key => '_session_id')] | |
| MultiSessionStore.stores[:secure] = [RedisSessionStore, session_options.merge(:key => '_secure_session_id', :secure => ['production', 'staging'].include?(Rails.env))] | |
| MultiSessionStore.default_store = :plain | |
| MultiSessionStore.routes = [ | |
| ['/admin', :secure], | |
| ] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'rubygems' | |
| require 'dalli' | |
| dc = Dalli::Client.new('localhost:11211') | |
| dc.set('abc', 123) | |
| value = dc.get('abc') | |
| puts value | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| for cookbook in $(find * -type d -maxdepth 0); do | |
| git clone ./ ../${cookbook} | |
| cd ../${cookbook} | |
| git remote rm origin | |
| git filter-branch --subdirectory-filter ${cookbook} -- --all | |
| git gc --aggressive | |
| done | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <stdio.h> | |
| #include <sys/stat.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| typedef struct { | |
| char *name; | |
| FILE *file; | |
| long inode; |