Skip to content

Instantly share code, notes, and snippets.

@elliottkember
elliottkember / framer-alternate-states.coffee
Last active August 29, 2015 14:03
When clicked, a layer can have an alternate image, an alternate background color, or an overlay!
Layer.define "alternateBackgroundColor",
exportable: true
default: ""
get: ->
@_getPropertyValue "alternateBackgroundColor"
set: (alternateBackgroundColor) ->
return if alternateBackgroundColor == @_getPropertyValue "alternateBackgroundColor"
@_setPropertyValue "alternateBackgroundColor", alternateBackgroundColor
originalBackgroundColor = @backgroundColor
@elliottkember
elliottkember / load.coffee
Created July 23, 2014 18:04
Load in CoffeeScript files with Framer
load = (scripts...) ->
for script in scripts
script = "#{script}.coffee" if script.indexOf '.' == -1
eval CoffeeScript.compile(Utils.domLoadDataSync(script))
load 'finderWindow', 'appStateMachine'
@elliottkember
elliottkember / Configurator.coffee
Last active August 29, 2015 14:04
A configurator for specifying properties on Framer layers! Example: http://elliott-prototypes.s3.amazonaws.com/Configurator.framer/index.html
Layer.prototype.destroyRecursively = ->
layer.destroyRecursively() for layer in @subLayers
@destroy()
class Configurator
constructor: (options) ->
@values = {}
@options = options
@callbacks = {}
@elliottkember
elliottkember / routes.rb
Created March 27, 2009 20:41
Simple OAuth in Rails
map.with_options :controller => 'user_sessions' do |session|
session.callback '/callback', :action => 'callback'
session.logout '/logout', :action => 'destroy'
session.login '/login', :action => 'new'
end
@elliottkember
elliottkember / dreamcatcher.rb
Created July 20, 2009 13:39
Dreamcatcher - An "mm_" checker for Gmail - deletes emails with links to sites that use Dreamweaver!
#! /usr/bin/ruby
## Elliott Kember's Delete MM_ Script.
# I bet you thought I wouldn't write this!
## Usage:
# $ ruby dreamcatcher.rb emailaddress password
## dreamcatcher.rb
# Tested on Ubuntu 8.10
apt-get update
# Git
apt-get install git-core -y
# Apache
/* Elliott Kember's jSnake, version 3 */
// Usage: new Snake()
// Adding options: new Snake({ width: 30, mouse_chasing: true })
// TODO: Add list of options
// Compass bearings for directions
UP = 0;
RIGHT = 90;
DOWN = 180;
LEFT = 270;
$(document).ready(function(){
if($.browser.safari){
height = parseInt($('#wrapper').css('height'));
number = height / 100;
for(i=0;i<number;i++){
$("<a name="+i+"></a>").css('position','absolute').css('top', i*100+'px').appendTo($('body'));
}
}
})
// Thanks to Joshua Hatfield (@fjhat) for the pluginizing!
(function($){
$.fn.ek3d = function(options) {
var defaults = {
strength: 5,
hex: '#aaaaaa'
};
@elliottkember
elliottkember / gist:367329
Created April 15, 2010 16:30
in /Applications/WebKit.app/Contents/Frameworks/10.6/WebCore.framework/Versions/A/Resources/inspector/inspector.css
.outline-disclosure li {padding: 1px 0 1px 14px;}
body.platform-mac.platform-mac-snowleopard .monospace,
body.platform-mac.platform-mac-snowleopard .source-code {font-family: 'Lucida Grande', monospace;}