Skip to content

Instantly share code, notes, and snippets.

View seabre's full-sized avatar

Sean Brewer seabre

  • CrowdFiber
  • Chattanooga, TN
View GitHub Profile
(auto_scroll = (start, height) ->
setTimeout (->
increment = height / 4
next_increment = start + increment
window.scrollTo start, next_increment
if next_increment < height auto_scroll(next_increment, height) else return true
), 8000
)(0, document.body.scrollHeight)
@seabre
seabre / innerheight.js
Created February 11, 2013 07:50
Crossbrowser innerHeight
(function(){
if(window.innerWidth!= undefined){
return [window.innerWidth, window.innerHeight];
}
else{
var B= document.body,
D= document.documentElement;
return [Math.max(D.clientWidth, B.clientWidth),
Math.max(D.clientHeight, B.clientHeight)];
}
@seabre
seabre / sightsee.rb
Created February 12, 2013 20:22
Automated, multibrowser 'click through' test to be used with sauce labs.
require 'rubygems'
require 'selenium-webdriver'
project = "Some Project"
browsers = {
"Firefox 18 (Windows)" => {:browser => Selenium::WebDriver::Remote::Capabilities.firefox, :platform => 'Windows 2008', :version => '18'},
"Firefox 6 (Windows)" => {:browser => Selenium::WebDriver::Remote::Capabilities.firefox, :platform => 'Windows 2003', :version => '6'},
"Safari 6 (OS X)" => {:browser => Selenium::WebDriver::Remote::Capabilities.safari, :platform => 'Mac 10.8', :version => '6'},
"Safari 5 (OS X)" => {:browser => Selenium::WebDriver::Remote::Capabilities.safari, :platform => 'Mac 10.6', :version => '5'},
@seabre
seabre / .tmux.conf
Created February 25, 2013 23:06
My tmux config.
# Default shell should be zsh
set-option -g default-shell /bin/zsh
set -g default-terminal "xterm"
#C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# Start numbering at 1
set -g base-index 1
@seabre
seabre / minblues.clj
Created February 26, 2013 06:11
Just playing around with stuff from the Overtone wiki. An endless minor blues.
; Just playing around with stuff from the overtone wiki.
; An endless minor blues.
(use 'overtone.live)
(use 'overtone.inst.sampled-piano)
(defn play-chord [a-chord]
(doseq [note a-chord] (sampled-piano note)))
(function(){var a=document.createElement("script");a.src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js";a.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(a);})()
@seabre
seabre / constant.clj
Last active December 14, 2015 08:59
Used in live-coding session for: https://soundcloud.com/seabre/constant
(use 'overtone.live)
(use 'overtone.inst.sampled-piano)
; arpeggiate-chord:
;
; Arpeggiate a given chord.
;
; instrument - Some sort of instrument function.
; a-chord - List of midi nums.
; spacing - Spacing between notes in milliseconds.
@seabre
seabre / git_cookbook.md
Last active December 14, 2015 17:29
Git cookbook.

Git Cookbook

Checkout remote branch

git checkout -t origin/my_remote_branch

Change current directory to root of git project

// helper to create proper asset paths if an asset host is configured
App.assets = {
assets : {
<% AssetsUtil.images.each do |img| %>
"<%= img %>" : "<%= asset_path(img) %>",
<% end %>
},
@seabre
seabre / app.js
Created April 6, 2013 03:56
Basic WebGL (with three.js) Template
var App = App || {};