Skip to content

Instantly share code, notes, and snippets.

View abhiaiyer91's full-sized avatar

Abhi Aiyer abhiaiyer91

  • Netlify
  • Los Angeles
View GitHub Profile
var app = angular.module('PromisesStillAllSoWastedOnMyself', []);
app.controller('YouCtrl', function(TextFromBuddyService){
//Some code goes here
var BuddyTextPromise = function () {
//Your buddy promised to Text you, so this service returns a promise
TextFromBuddyService.getUpdate()
//promise function method: success() or failure()
.success(function(update){
var MongoClient = require('mongodb').MongoClient;
MongoClient.connect('mongodb://localhost:27017/weather', function(err, db) {
if(err) throw err;
db.collection('data').find().sort({"State" : 1, "Temperature" : -1}).toArray(function(err, docs) {
if(err) throw err;
var newstate = "";
var query = {};
node_modules/.bin/jake $*
(function(){
'use strict';
desc('Build and Test');
task('default', ['start']);
desc('Example Task');
task('start', [], function() {
console.log("Here's the example task!");
})
(function() {
"use strict";
desc("Build and test");
task("default", ["lint"]);
desc("Let's do this Lint thing");
task("lint", [], function() {
var lint = require("./build/lint/lint.js");
var files = new jake.FileList();
function nodeLintOptions() {
return {
bitwise:true,
curly:false,
eqeqeq:true,
forin:true,
immed:true,
latedef:true,
newcap:true,
noarg:true,
window.app.factory('Parse', ['parseConstant', function(parseConstant) {
function getJob(){
var jobsObj = Parse.Object.extend("Jobs");
var query = new Parse.Query(jobsObj);
return query.find();
}
return {
getJob: getJob
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Mahaska</title>
<meta name="description" content="Mahaska Bottling Company (MBC) is a family owned and operated business distributing Pepsi products operating under a franchise from PepsiCo, Inc.">
<meta name="viewport" content="width=device-width">
@abhiaiyer91
abhiaiyer91 / gist:d946e6a8ff962ea571db
Created January 16, 2015 23:32
Sierpenskis Gasket
function sierpinski(n)
{
return (function s(n)
{
return !n ? ['L'] : s(--n).map(function (a)
{
return a + new Array((1 << (n + 1)) + 1).join(' ')
}).concat(s(n).map(function (a)
{
return a + ' ' + a
@abhiaiyer91
abhiaiyer91 / gist:de3dfe15f3f0f30b86c1
Created January 26, 2015 19:22
What the f@$k is this?
Template.samurai.created = function () {
console.log(this);
}
Template.samurai.rendered = function () {
console.log(this);
}
Template.samurai.events({
'click .sword': function (event, template) {