Skip to content

Instantly share code, notes, and snippets.

View jaredpalmer's full-sized avatar

Jared Palmer jaredpalmer

View GitHub Profile
@jaredpalmer
jaredpalmer / Youtube.js
Created February 21, 2015 18:32
Better YouTube Video Loads
// Library: Playing YouTube and Google Docs videos when image is clicked
var LibraryVideoPlay = (function() {
subscribeToPageLoad(
"^/lib/.*",
load, unload
);
function load() {
$(".article-video.youtube").click(youtubeVideoClicked);
@jaredpalmer
jaredpalmer / material.coffee
Created March 10, 2015 12:43
Material Design Framer Curves
MaterialCurve = "cubic-bezier(0.2, 0.0, 0.2, 1)"
MaterialTime = "0.6"
# The curve above is eyeballed to fit this particular case.
# The recommended material curves from google.com/design/spec are:
# MaterialCurveFastOutSlowIn = "cubic-bezier(0.4, 0.0, 0.2, 1)"
# MaterialCurveLinearOutSlowIn = "cubic-bezier(0.0, 0.0, 0.2, 1)"
# MaterialCurveFastOutLinearIn = "cubic-bezier(0.4, 0.0, 1, 1)"
# MaterialCurveSpringSimulation = "spring(260,30,0,0.01)"
@jaredpalmer
jaredpalmer / index.ios.js
Last active August 29, 2015 14:18
React Native Hello World
var React = require('react-native');
var { AppRegistry, Text } = React;
var App = React.createClass({
render: function() {
return (
<View>
<Text>Hello World!</Text>
</View>
);
@jaredpalmer
jaredpalmer / modify.js
Last active August 29, 2015 14:18
Modify Kimono API
function transform(data) {
// filter functions are passed the whole API response object
// you may manipulate or add to this data as you want
// query parameters exist in the global scope, for example:
// http://www.kimonolabs.com/apis/<API_ID>/?apikey=<API_KEY>&myparam=test
// query.myparam == 'test'; // true
for (var i = 0; i< data.results.collection1.length; i++){
var link = decodeURIComponent(data.results.stories[i].title.href)
var index = link.indexOf('=');
@jaredpalmer
jaredpalmer / functions.php
Created May 27, 2015 14:33
CodyHouse Wordpress Mega Menu
// This is the CodyHouse navigation for the clothing tab, it is overkill for the site.
function html5blank_mega()
{
wp_nav_menu(
array(
'theme_location' => 'header-nav',
'menu' => '',
'container' => 'nav',
'container_class' => 'menu-{menu slug}-container',

Perspective Scrolling in CSS ('-' * 28) A 3 dimensional scrolling experience built in CSS only. The trick is to rotate a single element around its x-axis, while its parent provides the perspective environment and a special perspective-origin.

Best viewed in Chrome/Safari on your desktop. Passed my test on Android, but lacks performance. Test failed on IOS7.

//

Update (tested under OSX 10.9.5):

meta.foundation-version {
font-family: "/5.4.7/"; }
meta.foundation-mq-small {
font-family: "/only screen/";
width: 0em; }
meta.foundation-mq-medium {
font-family: "/only screen and (min-width:40.063em)/";
width: 40.063em; }
@jaredpalmer
jaredpalmer / fbstart.css
Created October 8, 2015 20:56
FBstarter.css
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline
}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
@jaredpalmer
jaredpalmer / quip.js
Created December 16, 2015 19:19
Quip Extraction Endpoint for Express API
/**
* POST Extract content from Quip document.
* @param {String} id Quip thread ID
*/
import Q from 'quip.js';
import cheerio from 'cheerio';
const Q = new Quip({
// Quip Access Token (required)
accessToken: "XXXXXX"