Skip to content

Instantly share code, notes, and snippets.

View gchaturvedi's full-sized avatar

Gaurav Chaturvedi gchaturvedi

  • San Francisco, CA
View GitHub Profile
@gchaturvedi
gchaturvedi / gist:71edcb83c528b2c36936
Created July 31, 2014 03:11
sunshine_lesson1_adapter
package com.example.android.sunshine.app;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
var a = 1;
var d = 2;
function b() {
a = 5;
d = 23;
return;
function a() {}
}
b();
console.log(a);
function Person(name) {
this.name = name;
}
Person.prototype = {
constructor: Person, // does not doing this line have any consequences?
sayName: function() {
console.log(this.name); },
public class Hello {
public static void main(String [] args) {
System.out.println("Hello world!");
}
}
@gchaturvedi
gchaturvedi / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Graph actualGraph = new SingleGraph("actualFlight");
for(Airport airport: allAirports) {
actualGraph.addNode(airport.getCode());
actualGraph.getNode(airport.getCode()).setAttribute("ui.label", airport.getCode());
}
for(Flight flight: allFlights) {
String edgeCode = flight.getDepartureAirport().getCode() + "-" + flight.getArrivalAirport().getCode();
[ERROR] Exit code: 1 - /Users/gchaturvedi/Code/cs509/src/main/java/wpi/controllers/api/FlightsController.java:385: warning: no @param for request
[ERROR] private HashMap<String, String> buy(HttpServletRequest request,
[ERROR] ^
[ERROR] /Users/gchaturvedi/Code/cs509/src/main/java/wpi/controllers/api/FlightsController.java:385: warning: no @param for response
[ERROR] private HashMap<String, String> buy(HttpServletRequest request,
[ERROR] ^
[ERROR] /Users/gchaturvedi/Code/cs509/src/main/java/wpi/controllers/api/FlightsController.java:385: warning: no @param for list
[ERROR] private HashMap<String, String> buy(HttpServletRequest request,
[ERROR] ^
[ERROR] /Users/gchaturvedi/Code/cs509/src/main/java/wpi/controllers/api/FlightsController.java:385: warning: no @return
//
// main.m
// TimeAfterTime
//
// Created by Gaurav Chaturvedi on 10/17/15.
// Copyright © 2015 Gaurav Chaturvedi. All rights reserved.
//
#import <Foundation/Foundation.h>
:ttdium:
:ruby_version: ruby-2.0.0-p353
# tddium.yml
---
:ttdium:
:ruby_version: ruby-2.0.0-p353