This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am raglan-road on github. | |
* I am adamjmcintyre (https://keybase.io/adamjmcintyre) on keybase. | |
* I have a public key ASAQ_I--as0dAL2K5NOQFWOro1gtROlUr6P8lzzlKPvJIwo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some file, like layout-constants.js | |
export default BASE_PADDING = '1'; | |
export default BASE_UNIT = 'rem'; | |
// Another file, like blahcomponent.jsx | |
import * as CSS from 'layout-constants'; | |
const Componet = css(` | |
margin: 1.5*${BASE_PADDING}${BASE_UNIT}, | |
padding: ${BASE_PADDING}${BASE_UNIT} | |
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var used = []; | |
var people = { | |
tony: [], | |
dan: [], | |
adam: [], | |
jamal: [], | |
kevin: [], | |
dave: [] | |
} | |
var toassign = ['tony', 'dan', 'adam', 'jamal', 'kevin', 'dave']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jeremylew = window.jeremylew = (typeof window.jeremylew !== "undefined") ? window.jeremlew : {}, | |
foo = jeremylew.foo = (typeof jeremylew.foo !== "undefined") ? jeremylew.foo : {}, | |
bar = jeremylew.foo.bar = (typeof jeremylew.foo.bar !== "undefined") ? jeremylew.foo.bar : {}; | |
(bar.baz = function(){ }()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* the css here */ | |
@include keyframes(fadeIn) { | |
from { | |
height: 0; | |
opacity: 0; } | |
to { | |
height: auto; /* Not sure how well this will work */ | |
opacity: 1; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initMap = function(){ | |
var self = this; | |
return $.Deferred(function(dfd){ | |
if(self.mapLoaded){ | |
// Map is loaded y'all. | |
dfd.resolve(); | |
} | |
else{ | |
$.ajax( // load your thing) | |
.done(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Poll until an element is "available" in the DOM, returning a promise that resolves when the element is in the DOM and scriptable. | |
$.available = function (id) { | |
var _poll = function(id, dfd) { | |
if(document.getElementById(id)) { | |
dfd.resolve(document.getElementById(id)); | |
} | |
else { | |
setTimeout(function() { | |
_poll(id, dfd); | |
}, 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Why plugins? Think about using a plugin when you need a piece of reusable functionality that will be applied to | |
// an element - and potentially many elements - in a given UI. | |
// Resource: http://docs.jquery.com/Plugins/Authoring | |
// The basic plugin boilerplate | |
;(function($){ | |
$.fn.plugin = function(){ | |
// If your plugin needs to be chainable, return this! | |
return this; // this -> reference to calling jQuery Object e.g. $('.foo').plugin() => $('.foo') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.some-els').bind('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){ | |
// Do something! | |
$(this).removeClass('animation-class'); | |
}) | |
.addClass('animation-class'); | |
// One works, too | |
$('.some-els').one('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){ | |
// Do something once! | |
console.log('this would show once'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery support for CSS3's animationend, which fires when a keyframe animation completes. | |
// This covers all of the combinations of vendor prefixes for the event, so it will work cross-browser. | |
// transitionend would work the same way. | |
$('.some-el-that-you-are-animating').bind('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){ | |
// this => element that just animated | |
}); |