Skip to content

Instantly share code, notes, and snippets.

View justinpitts's full-sized avatar

Justin Pitts justinpitts

View GitHub Profile
@adunstan
adunstan / skeleton_query.sql
Last active January 23, 2019 20:50
generate a select query for a given table, with optional alias and compaction
create or replace function make_select_query (tablename text, tablealias text default null, compact boolean default false)
returns text
language plpgsql as
$$
declare
rec record;
crec record;
firstrow boolean := true;
result text := '';
@adunstan
adunstan / make_type_list.sql
Created February 9, 2011 13:47
make a type list for a given type for use in with things like set returning functions, with optional alias name
create or replace function make_type_list(tablename text, typealias text default null) returns text
language plpgsql as
$$
declare
rec record;
crec record;
firstrow boolean := true;
talias text := '';
@DipSwitch
DipSwitch / gdbinit
Created May 22, 2011 13:40
gdbinit74
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.4 (22/05/2011)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln, dipswitch
#
# FEEDBACK: https://www.reverse-engineering.net
@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@meiwin
meiwin / gist:2779731
Created May 24, 2012 06:00
Configure cxf wsdl2java to generate list setter in Maven
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.yourcompany</groupId>
<artifactId>yourartifact</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<dependencies>
@jboner
jboner / latency.txt
Last active June 17, 2024 02:27
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@roxberry
roxberry / Hadoop FS grep
Created April 30, 2013 16:10
Hadoop FS grep
hadoop fs -ls albumrelease-tracks/output/ | awk '{print $8}' | \
while read f
do
hadoop fs -cat $f | grep -q MT0002267152 && echo $f
done
@staltz
staltz / introrx.md
Last active June 17, 2024 07:04
The introduction to Reactive Programming you've been missing
@timvw
timvw / RemoteIteratorWrapper.scala
Created July 17, 2016 19:24
scala wrapper for hadoop remote iterator
case class RemoteIteratorWrapper[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) extends scala.collection.AbstractIterator[T] with scala.collection.Iterator[T] {
def hasNext = underlying.hasNext
def next() = underlying.next()
}
object Conversions {
implicit def remoteIterator2ScalaIterator[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) : scala.collection.Iterator[T] = RemoteIteratorWrapper[T](underlying)
}