Skip to content

Instantly share code, notes, and snippets.

View bryanberger's full-sized avatar
👨‍💻
always makin'

Bryan Berger bryanberger

👨‍💻
always makin'
View GitHub Profile
config = {
enabled: true,
items: [
{
inclusions: '',
message: 'Check out our awesome More than School campaign: click here',
url: '/more-than-school',
newtab: true,
label: 'mts',
style: 'mts',
@bryanberger
bryanberger / git_bible.md
Last active June 14, 2016 15:19 — forked from dmglab/git_bible.md
how to git

Note: this is a summary of different git workflows putting together to a small git bible. references are in between the text


How to Branch

try to keep your hacking out of the master and create feature branches. the [feature-branch workflow][4] is a good median between noobs (i have no idea how to branch) and git veterans (let's do some rocket sience with git branches!). everybody get the idea!

Basic usage examples

(function() {
// I would love to use matchmedia but its not supported by IE9, instead lets check the viewport width onresize
var $lightbox_form_container = $('.new_user_lightbox_form_container');
// run onload
updateModal();
// run onresize
$(window).resize(updateModal);
@bryanberger
bryanberger / simplemoduleexport.js
Last active December 13, 2015 22:09
Simple Module Export - Supports require.js defining of jQuery into the module.
//
// more documentation on the module pattern here: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
//
(function( factory ) {
// if require js is available use it to define jquery and require it.
if (typeof define !== 'undefined' && define.amd) {
define(['jquery'], factory);
} else if (typeof module !== 'undefined' && module.exports) {
var jQuery = require('jquery');
module.exports = factory( $ );
@bryanberger
bryanberger / SimpleCircularBuffer.js
Last active December 13, 2015 22:08
Simple Javascript Circular Buffer
/** one way of doing it **/
var CircularBuffer = exports.CircularBuffer = function(size) {
this.pos = 0
this._buf = []
this.size = size
}
CircularBuffer.prototype.get = function(i) {
if (i == undefined) i = 0;
if (i >= this.size) return undefined;