Skip to content

Instantly share code, notes, and snippets.

View jenrzzz's full-sized avatar

Jenner La Fave jenrzzz

View GitHub Profile
@jenrzzz
jenrzzz / .vimrc
Created August 1, 2019 23:55
Realize the sun doesn't go down — it's just an illusion CAUSED by the WORLD spinning 'ROUND
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
require 'forwardable'
class RecordRelation
extend Forwardable
include Enumerable
attr_reader :records
def_delegators :@records, :each
def initialize(records_array)
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);
# 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.
sudo rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm
.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]
#include <stdio.h>
float float_1( float a, float b ) {
return a + b;
}
float float2( float a, float b ) {
return a + b;
}
@jenrzzz
jenrzzz / test.s
Last active December 17, 2015 18:18
.section ".data"
.global fmt
fmt:
.asciz "uninit value: %d\n"
.section ".bss"
.global a
a: .skip 4
.section ".text"
@jenrzzz
jenrzzz / gist:5588205
Created May 15, 2013 23:19
tmux session switcher function
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
@jenrzzz
jenrzzz / client.go
Created April 16, 2013 06:46
199 Go sockets practice
package main
import ("net"; "fmt"; "log")
func main() {
conn, err := net.Dial("tcp", "localhost:9999")
if err != nil {
log.Panic(err)
}