Skip to content

Instantly share code, notes, and snippets.

:octocat:
Live and in stereo

Danny Garcia buzzedword

:octocat:
Live and in stereo
Block or report user

Report or block buzzedword

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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.
@buzzedword
buzzedword / JsonController.php
Last active Dec 13, 2015
Using JSONP with FosRestBundle
View JsonController.php
<?php
namespace Demo\Bundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
use Symfony\Component\HttpFoundation\JsonResponse; // Helper added in Symfony 2.1 for JSON responses
class JsonController extends FOSRestController
{
public function getJsonAction()
{
$data = array(
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 / bower-hitlist.md
Created Sep 21, 2012
Making the web a better place: Bower Hitlist
View bower-hitlist.md

NEW Organization Repo

Please find the new location for the bower hitlist in Github Orgs, rather than Gists. See you there!

https://github.com/bower-hitlist/bower-hitlist.github.com

Overview

Today, I'm starting a small campaign to make the state of the web better in my own way. With the advent of a unified package system like bower, it has never been easier to improve the lives of developers everywhere!

@buzzedword
buzzedword / ua.min.js
Created Sep 11, 2012
Minified UA library.
View ua.min.js
/*jslint browser: true, regexp: true, maxerr: 50, indent: 4 *//**
* A UserAgent detection library.
*
* This library relies on the navigator.userAgent property and hence does not
* work for custom UserAgent settings.
*
* Apart from supporting detection of major browser vendors, the library also
* supports detection of various devices.
*
* Copyright (c) 2012, Gopalarathnam Venkatesan
@buzzedword
buzzedword / git-trackall
Created Jul 11, 2012
Add to a folder on your path, chmod 755, run with git trackall
View git-trackall
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do git branch --track ${branch##*/} $branch; done
git fetch --tags
git fetch --all
@buzzedword
buzzedword / grunt-recess.js
Created Jul 10, 2012
Grunt.js for grunt-recess
View grunt-recess.js
/*global module:false*/
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-recess');
var recessOptions = function(bool) {
bool = ((typeof bool === 'undefined')? false : bool);
var config = {
compile: true,
compress: bool,
View clicktap.js
var click_or_tap = function(obj) {
//for property in obj, add "click " to property and use original value
var new_obj = {};
for(var property in obj) {
if (obj.hasOwnProperty(property)) {
if (forge.is.mobile()) {
new_obj["tap " + property] = obj[property];
}
else {
new_obj["click " + property] = obj[property];
You can’t perform that action at this time.