Skip to content

Instantly share code, notes, and snippets.

View jaredpalmer's full-sized avatar

Jared Palmer jaredpalmer

View GitHub Profile
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 / 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;
@stammy
stammy / high-dpi-media.scss
Created November 26, 2012 06:27 — forked from kimroen/high-dpi-media.scss
A Sass media query mixin that captures almost all high DPI aware devices.
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @kimroen */
/* */
@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
}
}
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
@timgaunt
timgaunt / gist:2659362
Created May 11, 2012 12:35
Facebook Like link without cookies or JavaScript
<a id="share-facebook" class="facebook" rel="nofollow" target="_blank" href="http://www.facebook.com/sharer.php?u=http://www.myurl.com" _fcksavedurl="http://www.facebook.com/sharer.php?u=http://www.myurl.com" title="Facebook - Link opens in a new window">Facebook</a>
import fs from 'fs'
import { interpolateName } from 'loader-utils'
// webpack config
const publicPath = 'static'
const filenameTemplate = '[name].[hash].[ext]'
const extensions = [
'png', 'jpg', 'jpeg', 'gif',
'ico', 'svg', 'otf', 'eot', 'svg',
'ttf', 'woff', 'woff2'
@dhanush
dhanush / nginx-conf
Last active August 9, 2016 19:09
NGINX configuration for having a nodejs server and wordpress behind an Nginx reverse proxy
upstream backend {
server <IP1>:<PORT>;
server <IP2>:<PORT>;
}
server {
listen 80;
server_name geektrust.in;
return 301 https://www.geektrust.in$request_uri;
}