Skip to content

Instantly share code, notes, and snippets.

View MarkBennett's full-sized avatar

Mark Bennett MarkBennett

View GitHub Profile
@nathany
nathany / show SQL in irb console
Created March 11, 2010 17:31
Rails SQL logging from console
ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT)
@MarkBennett
MarkBennett / tmux-session.sh
Created January 4, 2011 22:44
A script I use to quickly setup the tmux session I use for developement
#!/bin/sh
#
# window 0 = irc
# window 1 = development server
# window 2 = vim w/ autotest split
# window 3 = console
# window 4 = remote server
tmux new-session -s litdistco -n irc \; new-window -n server \; new-window -n vim \; split-window -d -p 30 \; new-window -n console \; new-window -n remote
@kennyp
kennyp / todo.vim
Created March 29, 2011 06:08
Find todos under current directory.
function! s:ToDoList ()
cclose
let task_list = []
for row in split(system('ack --column "(TODO|CHANGED|FIXME)"'), '\n')
let t = split(row, ':')
let task_dict = {'filename': t[0], 'lnum': t[1], 'col': t[2]}
let task_dict.text = substitute(join(t[3:-1]), '\s\+', ' ', '')
let task_list += [task_dict]
endfor
call setqflist(task_list, 'r')
@RSpace
RSpace / Gemfile
Created April 23, 2011 12:49
Running Capybara and RSpec without Rails
source 'http://rubygems.org'
gem 'rspec'
gem 'capybara', :git => 'https://github.com/jnicklas/capybara.git'
gem 'launchy'
gem 'ruby-debug19'
@wireframe
wireframe / be_lintable.rb
Created June 23, 2011 16:29
be_lintable.rb
require 'jslint'
# "var someJsExpresion = 'stuff';".should be_lintable
RSpec::Matchers.define :be_lintable do |expected|
match do |actual|
tmp_js_output_dir = Rails.root.join('tmp', 'js_lintable')
FileUtils.mkdir_p tmp_js_output_dir unless File.exists?(tmp_js_output_dir)
tmp_js_output = File.join(tmp_js_output_dir, 'output.js')
@MarkBennett
MarkBennett / LICENSE
Created January 17, 2012 21:44
Debugging JavaScript In the Trenches
Copyright (C) 2012 Mark Bennett, Paul Irish, Aicke Schulz
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 Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@scottburton11
scottburton11 / gist:3222152
Created August 1, 2012 00:58
Audio Compression for Voiceover

About compression

Audio compression is used to reduce the dynamic range of a recording. Dynamic range is the difference between the loudest and softest parts of an audio signal. It was originally used to guard against defects when cutting wax and vinyl phonograph records, but generally became useful as a way of increasing the loudness of an audio recording without achieving distortion.

The goal of most compression applications is to increase the amplitude of the softest parts of a recording, without increasing the amplitude of the loudest parts.

Compressor anatomy

Compressors generally all have the same conceptual parts. However, not all compressors present variable controls for all parts to the user. If you don't see all of your compressor's controls here, there's a chance it either has a fixed value (and no control), or is named something else:

Snow in canvas land

Other people's code is awful, and your own code from months previous counts as someone else's. With this and the festive spirit in mind, I dug up a canvas snow demo I made two years ago to see how bad my code really was.

Turns out the performance landscape has changed quite a bit, but after applying a couple of workarounds, best practices, and memory management, I got the demo running smoother than it ever did.

Ugh, I can't believe I just wrote "performance landscape". Anyway...

How does the demo work?

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: