Skip to content

Instantly share code, notes, and snippets.

@chrisn
chrisn / Dockerfile
Last active June 2, 2020 20:32
Compile audiowaveform for AWS Lambda
FROM amazonlinux:latest
RUN yum -y install make cmake3 autogen automake libtool gcc gcc-c++ wget tar gzip zip gd-devel flac-devel libvorbis-devel boost-devel libcurl-devel
# libid3tag
WORKDIR /root
RUN wget https://netix.dl.sourceforge.net/project/mad/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz
RUN tar xzf libid3tag-0.15.1b.tar.gz
WORKDIR /root/libid3tag-0.15.1b
RUN ./configure && make && make install
@rastasheep
rastasheep / keyrepeat.shell
Last active January 1, 2020 20:09 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Atom in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Atom if you're running vim mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@tarmann
tarmann / gist:5626210
Last active December 17, 2015 14:39
JavaScript: Underscore Mixin Namespace
/*
* Usage: _.namespace('App.Namespace.Here');
*
*/
_.mixin({
namespace: function (path) {
var objects = path.split('.'),
namespace = window;
@jstn
jstn / howisobamadoing.rb
Created September 29, 2012 21:07
howisobamadoing.com / howisromneydoing.com
# howisobamadoing.com / howisromneydoing.com
# (c) justinouellette.com MMXII
require 'rubygems'
require 'sinatra'
CACHE_TIME = 3600 # one hour
OBAMA_DATA_PATH = 'obama.txt'
ROMNEY_DATA_PATH = 'romney.txt'
@fzf
fzf / gist:2943492
Created June 17, 2012 05:25
Sublime Text 2 Vintage Mode Clipboard History
[
{ "keys": ["Y"], "command": "clipboard_copy",
"context": [{"key": "clipboardcopy_fake", "operator":"equal", "operand":true}, {"key": "setting.command_mode"}]
},
{ "keys": ["y"], "command": "clipboard_copy",
"context": [{"key": "clipboardcopy_fake", "operator":"equal", "operand":true}, {"key": "setting.command_mode"}]
},
{ "keys": ["D"], "command": "clipboard_copy",
"context": [{"key": "clipboardcopy_fake", "operator":"equal", "operand":true}, {"key": "setting.command_mode"}]
},
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@meleyal
meleyal / simplegrid.scss
Created November 30, 2011 17:24
SimpleGrid
/*! -----------------------------------------------
* simplegrid.scss
* https://gist.github.com/gists/1409900/
* Custom version of 960.gs (http://960.gs/)
* Naming inspired by SimpleBits (http://simplebits.com/)
* Licensed under GPL and MIT
*
* Custom:
* - columns > 12
* - underscores > dashes
@madrobby
madrobby / i18n.coffee
Created November 14, 2011 15:45
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')