This file contains 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
try | |
if !empty($LIGHT_MODE) | |
set background=light | |
colorscheme PaperColor | |
let g:airline_theme='papercolor' | |
else | |
set background=dark | |
colorscheme jellybeans | |
let g:airline_theme = 'jellybeans' | |
endif |
This file contains 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 'forwardable' | |
class RecordRelation | |
extend Forwardable | |
include Enumerable | |
attr_reader :records | |
def_delegators :@records, :each | |
def initialize(records_array) |
This file contains 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
describe 'test' do | |
it 'locks stuff' do | |
ActiveRecord::Base.connection.execute <<-SQL | |
BEGIN; | |
SELECT pg_advisory_lock(420); | |
SQL | |
Thread.new do | |
res = ActiveRecord::Base.connection.execute <<-SQL | |
SELECT pg_try_advisory_lock(420); |
This file contains 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
# Public: A fancy class for doing complicated group-bys. | |
# Construct it with a strategy object that responds to #key_for, #set, and | |
# #default_accumulator. | |
class Aggregator | |
attr_reader :strategy | |
# Public: Create a new Aggregator. | |
# | |
# strategy - An aggregation strategy object that responds to the following: | |
# #key_for(item) - takes an item from the collection and returns the key to use for it. |
This file contains 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
sudo rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm |
This file contains 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
.file "test.c" | |
.section ".text" | |
.align 4 | |
.global float_1 | |
.type float_1, #function | |
.proc 06 | |
float_1: | |
save %sp, -96, %sp | |
st %i0, [%fp+68] | |
st %i1, [%fp+72] |
This file contains 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> | |
float float_1( float a, float b ) { | |
return a + b; | |
} | |
float float2( float a, float b ) { | |
return a + b; | |
} |
This file contains 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
.section ".data" | |
.global fmt | |
fmt: | |
.asciz "uninit value: %d\n" | |
.section ".bss" | |
.global a | |
a: .skip 4 | |
.section ".text" |
This file contains 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
function sesh() { | |
if [[ $# -gt 0 ]]; then | |
case "$1" in | |
new) | |
tmux new -s "$2" | |
;; | |
*) | |
if tmux list-sessions | grep "attached"; then | |
tmux switch -t "$1" | |
else |
This file contains 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
package main | |
import ("net"; "fmt"; "log") | |
func main() { | |
conn, err := net.Dial("tcp", "localhost:9999") | |
if err != nil { | |
log.Panic(err) | |
} |
NewerOlder