Skip to content

Instantly share code, notes, and snippets.

View akahn's full-sized avatar

Alex Kahn akahn

View GitHub Profile

Culture

  • What do you like best about working there?
  • What do you like least?
  • How would you describe this company's culture? engineering culture?
  • What causes the most conflict among employees here?
  • What would you change if you could?
  • How has the company changed in the past five years? How do you think it will change in the next five?
  • How long has the longest serving team member been there?
  • What's the average or median tenure?
@itod
itod / split_keyboards.md
Last active April 24, 2024 16:06
Every "split" mechanical keyboard currently being sold that I know of
@sylt
sylt / ncurses_mouse_movement.c
Created November 22, 2015 20:17
Mouse movement example for NCURSES
// I had problems getting mouse movement events working in ncurses, but after
// some research, it seems as if this is how you can do it. The magic is in the
// printf("\033[?1003h\n") which was the missing piece in the puzzle for me
// (see console_codes(4) for more information). 1003 means here that all events
// (even position updates) will be reported.
//
// This seems to work in at least three X-based terminals that I've tested:
// xterm, urxvt and gnome-terminal. It doesn't work when testing in a "normal"
// terminal, with GPM enabled. Perhaps something for the next gist version? :)
@jj1bdx
jj1bdx / sleep5.sh
Created June 2, 2014 04:02
A shell one-liner for an infinite loop (sh/zsh/bash compatible)
while true; do date; sleep 5; done
@jordwalke
jordwalke / gist:6350319
Last active September 10, 2016 16:27
ReactJS: JavaScript just like you've always done it.
/**
* ReactJS: JavaScript like you've always done it.
*
* This example renders your top ten most followed friends/followers, `filter`ing
* only your favorites, and putting a star on all verified accounts.
*
* With ReactJS, any time your data changes, the UI is always brought up to date
* automatically. If friends length changes, or followCount - it always shows what
* `render` describes.
*/
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@nstielau
nstielau / client.sh
Created September 27, 2012 23:22
Sensu Push Example
echo '{
"handlers": ["debug"],
"name": "push_woot_test",
"output": "woot!",
"status": 0
}' | nc -w1 127.0.0.1 3030
@cpjolicoeur
cpjolicoeur / gist:3590737
Created September 1, 2012 23:15
Ordering a query result set by an arbitrary list in PostgreSQL

I'm hunting for the best solution on how to handle keeping large sets of DB records "sorted" in a performant manner.

Problem Description

Most of us have work on projects at some point where we have needed to have ordered lists of objects. Whether it be a to-do list sorted by priority, or a list of documents that a user can sort in whatever order they want.

A traditional approach for this on a Rails project is to use something like the acts_as_list gem, or something similar. These systems typically add some sort of "postion" or "sort order" column to each record, which is then used when querying out the records in a traditional order by position SQL query.

This approach seems to work fine for smaller datasets, but can be hard to manage on large data sets with hundreds (or thousands) of records needing to be sorted. Changing the sort position of even a single object will require updating every single record in the database that is in the same sort group. This requires potentially thousands of wri

A Corn Salad That Reminded Me of Chris and Beth

This salad reminds me of barbecuing in my friend's yard. We had many amazing barbecues there. I used some honey from their shop and other ingredients they'd probably sell or endorse. This is a take on a Mexican corn salad type thing. Use the herbs and other flavors to drive the direction you want to take it in! Also if you live in Brooklyn, visit their shop! http://easterndistrictny.com/

Ingredients

  • 6 ears of corn
  • various hot chiles, to taste
  • 1 tbsp light, fragrant honey (Greenpoint honey of course)
  • aged cheddar (I used "Krystal Pure Cave Aged Cheddar")
@amacdougall
amacdougall / .git-completion.bash
Created July 11, 2012 15:05
Change .git-completion.bash to ignore remotes
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#