Skip to content

Instantly share code, notes, and snippets.

View zsarge's full-sized avatar

Zack Sargent zsarge

View GitHub Profile
@jamis
jamis / recursive-backtracker2.rb
Created December 27, 2010 04:36
An implementation of the recursive backtracking algorithm that *gasp* actually uses recursion.
# --------------------------------------------------------------------
# Recursive backtracking algorithm for maze generation. Requires that
# the entire maze be stored in memory, but is quite fast, easy to
# learn and implement, and (with a few tweaks) gives fairly good mazes.
# Can also be customized in a variety of ways.
# --------------------------------------------------------------------
# --------------------------------------------------------------------
# 1. Allow the maze to be customized via command-line parameters
# --------------------------------------------------------------------
@unixcharles
unixcharles / nginx.conf
Last active June 1, 2024 13:34
nginx config for http/https proxy to localhost:3000
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@azproduction
azproduction / LICENSE.txt
Created November 28, 2011 14:03 — forked from 140bytes/LICENSE.txt
A turing machine in 79! bytes of javascript
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
@marioBonales
marioBonales / .bashrc
Created January 19, 2012 03:56
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@mccv
mccv / gist:3251441
Created August 3, 2012 20:55
Reverse Lambda, because fuck the next guy to read this
scala> class Foo {
| def <=: (f: (Int) => Boolean) = f(1)
| }
defined class Foo
scala> val f = new Foo()
f: Foo = Foo@a06812d
scala> { x:Int => true } <=: f
res5: Boolean = true
@dpr-odoo
dpr-odoo / JavaFieldReflection.java
Created June 24, 2014 03:16
Java Field Reflection - Getting non-null fields value using reflection
/**
* Java Field Reflection
* Getting non-null members (fields) value from parent class using Java Reflection
*
* @author Dharmang Soni <dpr@odoo.com>
*/
package com.reflection;
import java.lang.reflect.Field;
@JunichiIto
JunichiIto / alias_matchers.md
Last active July 18, 2024 15:03
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@nulpunkt
nulpunkt / oldest_todo.bash
Created October 27, 2014 10:48
Find the oldest TODO in the codebase
git grep -n -w "FIXME\|TODO\|XXX" | awk '{ print $1 }' | while read fileline; do
filename=`echo $fileline | cut -d: -f1`
lineno=`echo $fileline | cut -d: -f2`
time=`git blame -p -t $filename -L$lineno,$lineno | grep author-time | cut -d' ' -f2`
msg=`git blame $filename -L$lineno,$lineno`
echo "$time $fileline $msg"
done | sort | cut -d' ' -f1-