Skip to content

Instantly share code, notes, and snippets.

Avatar

Jasdev Singh jasdev

View GitHub Profile
@jasdev
jasdev / gist:3233676
Created Aug 2, 2012
Pardon the brevity
View gist:3233676
for(int i = 0; i < badges.length(); i++){
badgeList.add(new Badge(((JSONObject) (badges.get(i))).getString("name"), ((JSONObject) (badges.get(i))).getString("description"), ((JSONObject) (badges.get(i))).getString("id")));
}
@jasdev
jasdev / Runner2.java
Created Oct 31, 2012
Create duplicates through recursion
View Runner2.java
//Helping out a friend with a quick hack to make duplicates recursively (made in 2 mins)
import java.util.LinkedList;
public class Runner2 {
/**
* @param args
*/
@jasdev
jasdev / DummyContent.java
Created Nov 2, 2012
Async Task with Content
View DummyContent.java
package com.cs4720.drinkengine_android.dummy;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@jasdev
jasdev / jsonp.js
Created Dec 3, 2012
JSONP Call Scaffolding
View jsonp.js
function postCall(data) {
console.log("Data from JSON");
}
$(document).ready(function () {
var endpoint = //URL here
$.ajax({url: endpoint, dataType: "jsonp", success: postCall});
});
View cdls.txt
cdls() {
if [ -z "$1" ]; then
cd && ls
else
cd "$*" && ls
fi
}
alias cd=cdls
@jasdev
jasdev / sample.json
Created Jan 20, 2013
Sample Snapgraph /getuser out
View sample.json
{
_id: "octopi",
score: "3749",
children: [
{
name: "justdavesingh",
score: "5"
},
{
name: "vivekb",
@jasdev
jasdev / sample.json
Created Jan 20, 2013
Sample Snapgraph /leaderboard output
View sample.json
[
{
_id: "yodawg",
score: "72948"
},
{
_id: "vivekb",
score: "10557"
},
{
View rtb.txt
d8888b. .d88b. .d88b. d888888b d888888b db db d88888b d8888b. .d88b. db db
88 `8D .8P Y8. .8P Y8. `~~88~~' `~~88~~' 88 88 88' 88 `8D .8P Y8. `8b d8'
88oobY' 88 88 88 88 88 88 88ooo88 88ooooo 88oooY' 88 88 `8bd8'
88`8b 88 88 88 88 88 88 88~~~88 88~~~~~ 88~~~b. 88 88 .dPYb.
88 `88. `8b d8' `8b d8' 88 88 88 88 88. 88 8D `8b d8' .8P Y8.
88 YD `Y88P' `Y88P' YP YP YP YP Y88888P Y8888P' `Y88P' YP YP
@jasdev
jasdev / rtb.html
Created Apr 16, 2013
For future trolling
View rtb.html
<html>
<title>rtb</title>
<head>
<meta http-equiv="refresh" content="5; url=http://twitter.com/r00tth3b0x">
</head>
<body bgcolor="black">
<pre><center><font color="white">
d8888b. .d88b. .d88b. d888888b d888888b db db d88888b d8888b. .d88b. db db
88 `8D .8P Y8. .8P Y8. `~~88~~' `~~88~~' 88 88 88' 88 `8D .8P Y8. `8b d8'
View gist:7504303
“You could take all the gold that’s ever been mined, and it would fill a cube 67 feet in each direction. For what it’s worth at current gold prices, you could buy — not some — all of the farmland in the United States. Plus, you could buy 10 Exxon Mobils (XOM), plus have $1 trillion of walking-around money. Or you could have a big cube of metal. Which would you take? Which is going to produce more value?” - Warren Buffett