Skip to content

Instantly share code, notes, and snippets.

View buzzedword's full-sized avatar
:octocat:
Live and in stereo

Danny Garcia buzzedword

:octocat:
Live and in stereo
View GitHub Profile
<?php
// Stuff to figure out:
// - where should this file live and in what folder structure of /vendor
// - what namespace should this class have
// - how do you autoload this class?
// - how do you use this class within a controller
namespace Quickbase\Quickbase\{foldername};
@buzzedword
buzzedword / 0_reuse_code.js
Created December 5, 2013 20:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$("#submit-btn").on('click', function(event) {
event.preventDefault();
var form, url, data, requests;
form = $("#form");
url = form.attr('action');
data = form.serializeArray();
requests = {
getJsonAction : 'http://url.com' // No query param here. jsonp mode sets it.
<?php
// Stuff to figure out:
// - where should this file live and in what folder structure of /vendor
// - what namespace should this class have
// - how do you autoload this class?
// - how do you use this class within a controller
namespace Custom\Bundle\HelloWorldBundle;
@buzzedword
buzzedword / composer.json
Created October 22, 2012 15:37
symfony 2.1
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": {
"": "src/",
"ACH": "vender/quickbase/quickbase"
}
},
"require": {
@buzzedword
buzzedword / gist:2246110
Created March 30, 2012 03:04
Twitter Bootstrap: Grid Overlay
/*
* Grid Overlay for Twitter Bootstrap
* Assumes a 1.692em baseline grid (22px/13px)
*/
@media (min-width: 1200px) {
body {
background: -webkit-linear-gradient(
90deg,
rgba(0,0,0,0.05),
rgba(0,0,0,0.05) 4.545%,
@buzzedword
buzzedword / timer.js
Created October 20, 2011 19:56 — forked from wayko/timer
timer
var newYear = new Date(new Date().getFullYear() + 1, 1 - 1, 1);
$(document).ready(function(){
$('#defaultCountdown').countdown({until: newYear});
$('#removeCountdown').toggle(function() {
$(this).text('Re-attach');
$('#defaultCountdown').countdown('destroy');
}, function() {
$(this).text('Remove');
@buzzedword
buzzedword / ellipsis.js
Created July 20, 2011 18:40 — forked from qwertypants/ellipsis.js
Add ellipsis to any text. Choose amount of words to show.
String.prototype.ellipsis = function(numOfWords, _text, wordCount ) {
_text = this;
wordCount = _text.trim().replace(/\s+/g, " ").split(' ').length;
_text = _text.trim().split(' ');
_text.splice(numOfWords, wordCount, "...");
return _text.join(' ');
}
@buzzedword
buzzedword / loadjs.js
Created June 15, 2011 17:31 — forked from qwertypants/loadjs.js
Super tiny JS loader
// {String} f File name
// {Boolean} c Condition
// {undefined} [l,j,s] Shortcut for var.
var loadjs = function(f,c,l,j,s,a) {
a = ((typeof f == 'object')? f : []);
f = ((typeof f == 'undefined') ? '' :
((typeof f == 'object') ?
((typeof f[0] !== 'undefined')? f[0] : '')
: f));
l = f.length;
@buzzedword
buzzedword / aspHide
Created October 15, 2010 00:26 — forked from skoon/aspHide
jQuery.fn.innerWrap = function() {
var a, args = arguments;
return this.each(function() {
if (!a)
a = jQuery.clean(args, this.ownerDocument);
// Clone the structure that we're using to wrap
var b = a[0].cloneNode(true),
c = b;
// Find the deepest point in the wrap structure
while ( b.firstChild )