Skip to content

Instantly share code, notes, and snippets.

View whitmanc's full-sized avatar

Chris Whitman whitmanc

View GitHub Profile
source 'http://rubygems.org'
gem 'rails', '3.2.6'
gem 'mysql2'
group :assets do
gem 'sass-rails', "~> 3.2.0"
gem 'coffee-rails', "~> 3.2.0"
gem 'uglifier'
root :to => 'home#index', :constraints => lambda { |request| request.cookies['auth_token'] }
root :to => 'user_sessions#new'
@whitmanc
whitmanc / gist:3360240
Created August 15, 2012 13:37
Cocos2d-iphone prevent physics objects overlap
- (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event
{
CGPoint touchPoint = [touch locationInView:[touch view]];
touchPoint = [[CCDirector sharedDirector] convertToGL:touchPoint];
if(isTouch){
//
// Move the flake, check into consideration finger placement
// relative to the flake
initSortable: =>
$(@el).sortable
opacity: 0.6
cursor: 'move'
containment: 'footer'
update: =>
#ids = App.keyframeList().collection.pluck('id')
#console.log ids
@json = {}
$('#c9_android_or_ios button').removeClass('active')
$('#c9_android_or_ios button:nth-child(2)').addClass('active')
widgetAtPoint: (point) ->
widgetWithHighestZ =
_.max @widgets, (widget) ->
if widget.getIsVisible() and widget.isPointInside(point)
return widget.getZOrder() unless typeof widget.getZOrder isnt "function"
return widgetWithHighestZ if widgetWithHighestZ
for widget,i in @widgets
if widget.getIsVisible() and widget.isPointInside(point)
@whitmanc
whitmanc / gist:3943844
Created October 24, 2012 04:32
MP3 File Recognizer
package recognizer;
/*
* Copyright 1999-2004 Carnegie Mellon University.
* Portions Copyright 2004 Sun Microsystems, Inc.
* Portions Copyright 2004 Mitsubishi Electric Research Laboratories.
* All Rights Reserved. Use is subject to license terms.
*
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL
@whitmanc
whitmanc / align.rb
Last active August 29, 2015 14:05
To use, run `ruby align.rb "path_to/audio.wav" "For J and C, with all my love"`
regExp = /\(([^)]+)\)/;
times = []
timesPretty = ""
if ARGV.length < 2
puts "Needs 2 args input to parse: 1. audio path and 2. text that matches audio"
else
# Make variables from parameters
audioPath = ARGV[0]
text = ARGV[1]
##
# Main view of app with left/right slide panels.
# The dashboard also houses the message list
# and new message form. To access anything other
# than a list of messages, we navigate to a new
# page
#
# @class DashboardView
#
define [
class App.Views.SectionTabsView extends Backbone.View
template: JST['clients/section_tabs']
events:
'click li': 'menuItemClicked'
render: ->
@$el.append @template()
menuItemClicked: (e) ->