Skip to content

Instantly share code, notes, and snippets.

Avatar

Abhi Aiyer abhiaiyer91

  • Workpop
  • Los Angeles
View GitHub Profile
View youctrl.js
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){
View answers.js
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 = {};
View jakefile.js
(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();
View nodelintoptions.js
function nodeLintOptions() {
return {
bitwise:true,
curly:false,
eqeqeq:true,
forin:true,
immed:true,
latedef:true,
newcap:true,
noarg:true,
View gist:49e75e5cbbf74b171e4d
(function(){
'use strict';
desc('Build and Test');
task('default', ['start']);
desc('Example Task');
task('start', [], function() {
console.log("Here's the example task!");
})
View careers.js
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
View gist:2d81d4a3e7ccf94e9f62
<!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">
View gist:d946e6a8ff962ea571db
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
View gist:de3dfe15f3f0f30b86c1
Template.samurai.created = function () {
console.log(this);
}
Template.samurai.rendered = function () {
console.log(this);
}
Template.samurai.events({
'click .sword': function (event, template) {