Skip to content

Instantly share code, notes, and snippets.

View jshaw's full-sized avatar
🤖
👨‍🎨 👨‍💻

Jordan Shaw jshaw

🤖
👨‍🎨 👨‍💻
View GitHub Profile
@jshaw
jshaw / drawdrip.html
Created July 27, 2012 20:54
Draw and Drip (processing)
<!doctype html>
<html>
<head>
<script type="text/javascript" src="processing.js"></script>
</head>
<body>
<div class="learning-demo">
<script type="application/processing">
@jshaw
jshaw / Tests.FBResize.js
Created July 30, 2012 22:49
Possibilities
window.onload = function() {
FB.Canvas.setSize({ height: $(window).outerHeight() });
}
window.onload = function() {
setTimeout(function(){
FB.Canvas.setAutoGrow();
},1000);
}
@jshaw
jshaw / alertOrder.js
Created August 2, 2012 19:55
Checking execution order based on document and window ready / load state within a Facebook iFrame canvas ( page tab or app).
// Checking execution order based on document and window ready / load state within a Facebook iFrame canvas ( page tab or app).
// Executes 1st
// Same as $(document).ready(function(){});
$(function() {
alert('1');
});
// Executes 2nd
$(window).load(function() {
@jshaw
jshaw / virticalAlignImg.js
Created August 9, 2012 20:01
Vertically aligning images in a div (Fix for IE8 & 9)
// WORKS FF, Chrome, Safari, IE 8 & 9 etc...
$('.extra-content .graphics img').load(function() {
$(this).css('marginTop', $(this).parents('.graphics').height() / 2 - $(this).height() / 2 );
});
// DOESN'T WORK IE8 & 9
// With multiple images on a page this script seems unable to compute the marginTop var.
// However placing it directly into the CSS method works as shown above.
$('.extra-content .graphics img').load(function() {
var marginTop = $(this).parents('.graphics').height() / 2 - $(this).height() / 2;
@jshaw
jshaw / IE8BackgroundOpacitySolution.css
Created October 30, 2012 17:17
IE8 Transparency / Opacity explination
/*
This is based on the assumption that the .pop-background element is inserted into the DOM at the bottom of the page after initial page load when the modal is initiated on click.
*/
.pop-background {
/* Works when inserted into the DOM after page load. Data-uri's work as well as hosted images. */
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9JREFUeNpiYGBgiAEIMAAAYQBdPMcrbwAAAABJRU5ErkJggg==") 0 0 repeat;
/*
Does not work when inserted after the DOM is initially loaded for the first time. The element will have no opacity filter applied.
background: black;
@jshaw
jshaw / index.html
Created November 14, 2012 18:14 — forked from anonymous/index.html
A CodePen by trickeedickee. CSS3 AT-AT - A pure CSS3 experiment I created. I could do with reducing the number of divs used to create the body parts. I also need to streamline the animations.
<div id="main">
<div id="head-neck-body">
<div id="head-neck">
<div id="head">
<div class="shape02"></div>
<div class="shape0"></div>
<div class="shape01"></div>
@jshaw
jshaw / glossary.json
Created November 14, 2012 21:30
JSON Glossary Structure
var terms = {
"terms" : {
Lorem : {
"term": "Lorem",
"definition" : "Lorem: Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
},
ullamco : {
"term": "ullamco",
"definition" : "ullamco: Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
},
@jshaw
jshaw / amigo-radio.html
Created November 16, 2012 19:29
Radio styles for a form
<!--
HTML UPDATES
Where there are input values for the amigo animal type remove the JS that styleizes the radio buttons so we just have straight labels and inputs.
Make the output of the radio buttons resemble what is below. A wrapper and than label, input for that animal.
Add some new classes. I added the class amigo-type and to the wrapper div, animal-label class to the label elements inside and animal-input class to the input radio buttons.
-->
@jshaw
jshaw / fb-app-request-custom-filter.js
Created November 30, 2012 17:21
FB App request with custom filter for ID
https://apps.facebook.com/fbrelll/fb.ui/apprequests
document.getElementById('send-to-many').onclick = function() {
FB.ui({
method: 'apprequests',
filters: [{name: 'Coffee Lovers', user_ids: [UID,UID,UID,UID]}],
message: 'You should learn more about the Platform.'
}, Log.info.bind('send-to-many callback'));
}
@jshaw
jshaw / particle_iceland_bike_example
Created November 20, 2015 20:23
particle iceland bike example
// http://apis.is/cyclecounter
// particle webhook GET ice_bikes "http://apis.is/cyclecounter"
// Jordans-MacBook-Pro:~ jshaw$ particle webhook GET ice_bikes "http://apis.is/cyclecounter"
// Sending webhook request { uri: 'https://api.particle.io/v1/webhooks',
// method: 'POST',
// json:
// { event: 'ice_bikes',
// url: 'http://apis.is/cyclecounter',
// deviceid: undefined,