Skip to content

Instantly share code, notes, and snippets.

View jaredpalmer's full-sized avatar

Jared Palmer jaredpalmer

View GitHub Profile
@carambula
carambula / Framer Class Loop
Created August 16, 2013 19:43
With Framer, I often need to access a class of views like "all of the views that scroll" or "all of the profile pics". Here's how I do it: 1. In Photoshop, I name all of the layergroups I want access to with a keyword. ie: Highlights 2013 FramerPager Photos 2013 FramerPager Highlights 2012 FramerPager (see a pattern? This is both good naming AND…
for (var layerGroupName in PSD) {
view = PSD[layerGroupName];
// Change FramerPager here to your keyword
if (view.name.indexOf("FramerPager") != -1){
// do something with that thing!
// one idea is to add it to an array for access later
// or you cold set their css style, set their positions, whatever
// in the demo below I make a new FramerPager for it so it… pages
}
}
@refringe
refringe / sendy-server
Last active February 5, 2024 07:50
Nginx configuration file example for Sendy (http://sendy.co/).
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;
endScrollMomentum = function(event) {
var animation, constant1, constant2, totalVelocity, touchEvent, velocity;
touchEvent = Events.sanitize(event);
constant1 = 1000;
constant2 = 0;
velocity = dragger.calculateVelocity();
class TextView extends View
constructor: (args) ->
super
@text = args?.text or ""
@define "text",
get: -> @html
set: (value) ->
@html = value
start = function() {
all my framer code
}
preloadImages = ["a.png", "b.png"];
preloadImagesCount = 0; // How many images were loaded
preloadImages.map(function(image) {
var imageLayer = new Layer({image:image})
imageLayer.on("load", function() {
@elliottkember
elliottkember / layerbrowser.coffee
Last active December 14, 2021 12:49
Layer browser for imported Sketch / PSD files in Framer
class LayerBrowser
constructor: (options) ->
@objects = []
@restore = options.restore
@_setup()
@add options.import if options.import
add: (object) ->
@objects.push object
@elliottkember
elliottkember / AppStateMachine.coffee
Last active August 9, 2018 14:32
A simple application framework for Framer
EventEmitter = (require?("./EventEmitter") || Framer).EventEmitter
class AppStateMachine extends EventEmitter
constructor: ->
@states = []
# Start the state machine with the document's hash, or the given route
start: (name) ->
@go if document.location.hash then document.location.hash[1..-1] else name
@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'
@scottmcpherson
scottmcpherson / 301 Nginx Meteor
Last active August 29, 2015 14:06
Meteor Nginx 301 Redirect - Force non www URL
# Upstreams
# Note: if you want to run multiple meteor apps on the same server,
# make sure you define a separate port for each.
upstream yoursite {
server 127.0.0.1:3000;
}
# HTTP Server
server {
listen 0.0.0.0:80;
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version