Skip to content

Instantly share code, notes, and snippets.

@briandeheus
briandeheus / punk.py
Last active April 1, 2022 02:53
Don't be a punk, punk
import binascii
import struct
class Punk(object):
_END_CHUNK_TYPE = 'IEND'
_PUNK_CHUNK_TYPE = 'puNk'
_MAX_BYTES = 2147483647
_chunks = dict()
@vasanthk
vasanthk / System Design.md
Last active March 29, 2024 06:27
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ctechols
ctechols / compinit.zsh
Last active March 6, 2024 08:37
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@staltz
staltz / introrx.md
Last active March 29, 2024 06:13
The introduction to Reactive Programming you've been missing
@wrouesnel
wrouesnel / .remote-backup-excludes.txt
Last active September 5, 2021 23:32
A script for performing a remote backup to another server using rsync and bup for versioning.
# this is an rsync-excludes format list of files to exclude.
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@pyrtsa
pyrtsa / gist:6213784
Created August 12, 2013 18:46
When installing Haskell Platform fails on Mac OS X (with quick fix below)

When installing Haskell Platform fails on Mac OS X (with quick fix below)

I was fighting with Haskell last weekend. At first, I couldn't install some missing libraries with Cabal, and then, when trying to find out what's wrong, I ended up removing the whole Haskell installation — only to find out I could no longer install neither the Haskell Platform nor even just Cabal Install! The warnings I would see were more or less about the use of the single quote in source code:

Preprocessing library text-0.11.2.3...

Data/Text.hs:6:52:
     warning: missing terminating ' character [-Winvalid-pp-token]

-- Copyright : (c) 2009, 2010, 2011, 2012 Bryan O'Sullivan,

In case you don't know me already, I'm Jarrod Nettles, a Senior Developer at Apple Inc. I also go by the Twitter handle @hayvok, and blackshawk on Github (don't ask me why they're different). I have no real, formal blog since, well, I work at Apple. I'm posting this because I confused a good many people and I feel honor-bound to explain.

On April 1st Hacker News had their "Who's Hiring" thread. Since I'm currently looking for a developer, I decided to go ahead and post. Here's the content of that post, along with a link to the original.

https://news.ycombinator.com/item?id=5475813 - Original HN Post

Apple Inc: Cupertino, CA - Web Developer (PHP, Node.js, Ember.js) - Sorry, no remote!! Relocation offered. (I know, I know...) We're rebuilding an internal app from scratch and it needs to be blazing fast and real-time.
Here's our tech stack (right now).
@witoff
witoff / Poll_Coinbase.js
Last active December 15, 2015 08:39
Poll Coinbase for Coin Availability
/* COMPILED:
* Add this snippet as a bookmark and click while on this url:
* https://coinbase.com/buys to check for coin availability every 60 seconds.
* Will sound an audible alarm when coins are available, if using a compliant browser (use chrome).
* Note: Don't DDOS our friends at coinbase!
*/
javascript:var%20s%3Ddocument.createElement%28%27script%27%29%3Bs.setAttribute%28%27type%27%2C%20%27text/javascript%27%29%3Bs.innerHTML%3D%22var%20beep%3D%28function%28%29%7Bvar%20ctx%3Dnew%28window.audioContext%7C%7Cwindow.webkitAudioContext%29%3Breturn%20function%28duration%2Ctype%2CfinishedCallback%29%7Bduration%3D%2Bduration%3Btype%3D%28type%255%29%7C%7C0%3Bif%28typeof%20finishedCallback%21%3D%27function%27%29%7BfinishedCallback%3Dfunction%28%29%7B%7D%7Dvar%20osc%3Dctx.createOscillator%28%29%3Bosc.type%3Dtype%3Bosc.connect%28ctx.destination%29%3Bosc.noteOn%280%29%3BsetTimeout%28function%28%29%7Bosc.noteOff%280%29%3BfinishedCallback%28%29%7D%2Cduration%29%7D%7D%29%28%29%3B%24%28%27%23transfer_btc%27%29.fo