Skip to content

Instantly share code, notes, and snippets.

View bittersweetryan's full-sized avatar

Ryan Anklam bittersweetryan

View GitHub Profile
//create a var for tracking if the element
//is currently moving or not
var moving = false;
$('a').on('click', function(){
var moveMe = $('#moveMe');
//if the element is moving clear the queue
//and stop the animation
if( moving ){
$( 'a' ).on( 'click', function(){
var moveMe = $( '#moveMe' );
moveMe.slideUp(1500,updateQueueCount)
.slideDown(1500,updateQueueCount)
.slideUp(1500,updateQueueCount)
.slideDown(1500,updateQueueCount);
updateQueueCount();
<script src="https://traceur-compiler.googlecode.com/git/bin/traceur.js" type="text/javascript"></script>
<script src="https://traceur-compiler.googlecode.com/git/src/bootstrap.js" type="text/javascript"></script>`
<script type="script/traceur">
module carFactory{
//module code here
}
</script>
var car = (function() {
"use strict";
return Object.preventExtensions(Object.create(null, {}));
}).call(this); //binds this to the global object inside the module
@bittersweetryan
bittersweetryan / gist:3852575
Created October 8, 2012 13:35
A better looking sublime...
  • Install Refined-Hybrid theme using Package Control
  • Install Tomorrow Color Schemes using Package Control
  • Set Theme to Refined-Hybrid
    • Preferences -> Settings-User
    • change "theme" to Refined-Hybrid.sublime-theme. Your theme line should look like this: "theme": "Refined-Hybrid.sublime-theme"
  • Set Color Scheme to Tomorrow Night
    • Preferences -> Color Scheme -> Tomorrow Color Schemes -> Tomorrow-Night
@bittersweetryan
bittersweetryan / partial.cfc
Created October 4, 2012 18:38
partial aplication
<cfscript>
var getFilings = makeFilingGetter(filing,
password,
username,
filingEndpoint,
attachmentEndpoint);
var results = getFilings("COMPANY",
filter,
variables.serffFields);
@bittersweetryan
bittersweetryan / partial.cfc
Created October 4, 2012 18:34
real world partial
<cfscript>
private Function function makeFilingGetter(Any filing,
String password,
String username,
String filingEndpoint,
String attachmentEndpoint){
return function(String entity, String filter, String fields){
return filing.getFilings(username,
@bittersweetryan
bittersweetryan / test.cfm
Created October 4, 2012 18:27
partial application
<cfscript>
test = new test();
addOne = test.makeAdder(1);
addFive = test.makeAdder(5);
writeOutput( addOne( 1 ) ); //2
writeOutput( addOne( 2 ) ); //3
writeOutput( addFive( 1 ) ); //6
@bittersweetryan
bittersweetryan / adder.cfc
Created October 4, 2012 18:26
make adder
<cfscript>
public Function function makeAdder(a){
return function (b){
return a + b;
};
}
</cfscript>