Skip to content

Instantly share code, notes, and snippets.

View bsturdivan's full-sized avatar

Brian Sturdivan bsturdivan

View GitHub Profile
@bsturdivan
bsturdivan / gist:1345588
Created November 7, 2011 17:25 — forked from jeffmicklos/gist:1329185
Programming 101 - if you fail this, I don't want you.
// 1) Write a loop that prints out 1 - 50
// 2) Now I want the same output but without a loop
// 3) Now if current number if a multiple of 3, print 'Fizz' instead of the number
// If it is a multiple of 5 print 'Buzz' instead of the number
// If it is a multiple of 3 and 5, print 'FizzBuzz' instead of the number
**All variable names and location of their definitions matter
@bsturdivan
bsturdivan / Death is nothing at all
Last active October 3, 2015 05:38
Death is nothing at all
Death is nothing at all
I have only slipped away into the next room
I am I and you are you
Whatever we were to each other
That we are still
@bsturdivan
bsturdivan / gist:3670613
Created September 7, 2012 23:14
Resize iframe
define(['jquery', 'utils'], function($, utils) {
$.widget( 'cbsi.videoResize', {
options: {
maxwidth: 480
},
_create: function() {
@bsturdivan
bsturdivan / gist:3783485
Created September 25, 2012 18:08
Filter Menu
define(['jquery', 'pkg.utils', 'plugins/widget'], function($, utils) {
$.widget("cbsi.filterMenu", $.cbsi.widget, {
/*
TERMS:
Avtive State - Buttons highlighted, select window open.
Inactive State - Buttons contain default styles, select window hidden,
Selected - Item highlighted, event triggered to update feed
@bsturdivan
bsturdivan / gist:3894413
Created October 15, 2012 19:01
mediaResize - Uncommented
define(['jquery', 'pkg.utils', 'plugins/widget'], function($, utils) {
$.widget("cbsi.mediaResize", $.cbsi.widget, {
options: {
mediaObjects: null;
},
//VARS
hasEvents: false, //Events have been added
@bsturdivan
bsturdivan / gist:3895654
Created October 15, 2012 21:29
mediaResize - Commented
define(['jquery', 'pkg.utils', 'plugins/widget'], function($, utils) {
/**
* Finds and resizes media elements in a document
* @param {array} mediaObjects
* @this - Block level element with child text nodes
* @extends cbsi.widget
*
* Examples:
*
<!-- The Markup -->
<div class="container">
<a href="" class="leaderboard-story">
<div></div>
<div></div>
</a>
<a href="" class="leaderboard-story">
<div></div>
<div></div>
</a>
.content-header {
&.content-header-title {
padding: $spacing-block-base 0 ($spacing-block-base * 2) 0;
border-bottom: 1px solid $color-border;
margin-bottom: 30px;
font-size: ($font-size-base * 3.25);
.h {
margin-bottom: 0;
color: $gray-light;
$.extend(MyClass.prototype, {method: function() {
var i = 0,
stacey = hair,
crazy = hair.length;
for(;1<=crazy;1++) {
console.log("Let's face it, this is an infinite loop");
}
}});
@bsturdivan
bsturdivan / gist:6325593
Last active December 21, 2015 15:19
Promises.js
var Promise = function() {
var response = null,
successCallback = null;
return {
resolve: function(value) {
response = value;
if(successCallback) {