Skip to content

Instantly share code, notes, and snippets.

:octocat:
Live and in stereo

Danny Garcia buzzedword

:octocat:
Live and in stereo
View GitHub Profile
@buzzedword
buzzedword / 0_reuse_code.js
Created Dec 5, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View ajax-events.js
$("#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.
View CustomHelloWorldBundle.php
<?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;
View HelloWorld.php
<?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};
View composer.json
{
"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 Mar 30, 2012
Twitter Bootstrap: Grid Overlay
View gist:2246110
/*
* 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 Oct 20, 2011 — forked from wayko/timer
timer
View timer.js
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 Jul 20, 2011 — forked from qwertypants/ellipsis.js
Add ellipsis to any text. Choose amount of words to show.
View ellipsis.js
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 Jun 15, 2011 — forked from qwertypants/loadjs.js
Super tiny JS loader
View loadjs.js
// {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;
View 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 )
You can’t perform that action at this time.