Skip to content

Instantly share code, notes, and snippets.

@btrepp
btrepp / Makefile
Last active December 1, 2021 04:02
Simple makefile that does javascript fingerprinting so cache times can be configured forever. Requires xidel, grep, md5sum and sed
#This make file will build a fingerprinted version of the application into the OUTDIR variable.
#It checks html files for src="stuff.js" references, and replaces them with fingerpints
#The finger printed file keeps the same directory structure in OUTDIR.
#You can debug your app locally by just loading the files directly. Then run make to get
#The cacheable version in OUTDIR
#Only files referenced in the html are copied into OUTDIR.
#Variables
@benolee
benolee / avoiding-hash-lookups-in-ruby.md
Created September 5, 2012 14:20
Avoiding Hash Lookups in a Ruby Implementation

Permalink

Avoiding Hash Lookups in a Ruby Implementation

I had an interesting realization tonight: I'm terrified of hash tables. Specifically, my work on JRuby (and even more directly, my work optimizing JRuby) has made me terrified to ever consider using a hash table in the hot path of any program or piece of code if there's any possibility of eliminating it. And what I've learned over the years is that the vast majority of execution-related (as opposed to data-related, purely dynamic-sourced lookup tables) hash tables are totally unnecessary. Some background might be interesting here.

Hashes are a Language Designer's First Tool

@mediabounds
mediabounds / floatsign.sh
Last active March 31, 2024 18:43
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the