Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jbavari's full-sized avatar
🏠
Working from home

Josh Bavari jbavari

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jbavari on github.
  • I am jbavari (https://keybase.io/jbavari) on keybase.
  • I have a public key ASCCLgv0jjgZyCSfS2BijP7uDcrCIIzFlHorrYZXq1uNJQo

To claim this, I am signing this object:

@jbavari
jbavari / gist:116c777117d511d51d5e
Created March 10, 2015 22:59
Quick prompt example
var q = require('q');
var askPrompt = function() {
var deferred = q.defer();
var prompt = require('prompt');
var promptProperties = {
selection: {
name: 'selection',
description: 'Address Selection: '.yellow.bold,
@jbavari
jbavari / app.js
Created December 8, 2014 19:29
Node API server with CORS disabled, AngularJS controllers with proxy and no proxy, and the ionic.project settings to allow proxy
var express = require('express')
var app = express()
app.get('/api/feed', function(req, res) {
res.json({name: 'feed', items: ['first', 'second']})
})
var server = app.listen(3000, function () {
var host = server.address().address
@jbavari
jbavari / felony-football.coffee
Created October 15, 2014 06:57
Hubot script for felony football
# Description:
# Make hubot fetch the national felony football scores
#
# Dependencies:
# "cheerio": "^0.17.0"
#
# Configuration:
# None
#
# Commands:
//Copy and paste this in the developer console on http://www.usatoday.com/sports/nfl/arrests/
var teams = {};
//Index is index in array for each, item is the html element
var getTeamCounts = function getTeamCounts(index, item) {
console.log('index: ', index, ' item: ', item);
var teamAtr = $(item).html();
console.log('teamAtr: ', teamAtr);
var teamCount = teams[teamAtr];
{
"tour": [
{
"brewery": "Boulder Beer",
"url": "http://boulderbeer.com/beers",
"beer": "Hazed and Infused",
"topic": "Dealing with Hazy specifications"
},
{
"brewery": "Upslope Brewery",
@jbavari
jbavari / karma.conf.js
Created June 11, 2014 23:34
Karma init file
// Karma configuration
// Generated on Wed Jun 11 2014 09:51:52 GMT-0500 (CDT)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
@jbavari
jbavari / Grunt task for shell plugin
Created November 9, 2013 21:57
Quick set of files for our states of our app and the grunt task to print them off to command line
print_state_diagram: {
options: {
stdout: true
},
command: function() {
// var states_chart = grunt.file.read('states.js');
var glob = require('./states.js');
var states = glob.states;
grunt.log.writeln("Total number of states: " + states.length + "\n");