Skip to content

Instantly share code, notes, and snippets.

View shurane's full-sized avatar

Ehtesh Choudhury shurane

  • Astoria, NY | Seattle, WA
  • 20:10 (UTC -07:00)
View GitHub Profile
<remote name="TeamNDVRu"
fetch="https://github.com/TeamNDVRu" />
<project path="vendor/htc/endeavoru" name="android_vendor_htc_endeavoru" remote="TeamNDVRu" revision="jellybean" />
<project path="device/htc/endeavoru" name="android_device_htc_endeavoru" remote="TeamNDVRu" revision="jellybean" />
<!--<project path="kernel/htc/endeavoru" name="htc-kernel-endeavoru" remote="TeamNDVRu" revision="jellybean" />-->
@shurane
shurane / app.js
Last active December 13, 2015 23:48
I'm running an express.js app, and req.params, req.body, and req.query are empty! Even though I'm trying to send JSON data over POST to it! Order matters. Move all the app.use() calls before app.post and voila. Works.
var express = require('express');
var app = express();
// routes
app.post('/payment', function(req, res){
console.log("======");
console.log(req.headers);
console.log(req.params);
console.log(req.body);
@shurane
shurane / lesson1.markdown
Last active December 15, 2015 20:58
First in a series of NetLogo/Logo lessons. This should take approximately 1 hour. After going through the experiments, the students should be allowed to experiment making whatever shapes that they feel like. Perhaps challenging each other to make more bizarre shapes.

lesson1: Turtling.

With NetLogo open and the Interface tab selected, try out the following in the Command Center:

This is how you make a turtle:

create-turtles 1

We are going to ask our turtles to draw underneath them as they move.

@shurane
shurane / AndroidManifest.xml
Created April 28, 2013 17:18
SetupWizard AndroidManifest.xml. Check out the `<intent-filter>` tag for seeing how SetupWizard.apk runs on boot.
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="130" android:versionName="1.3" package="com.google.android.setupwizard"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.BACKUP" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
def m(n):
"""
m(0) is undefined
"""
bowls = [1 for bowl in xrange(n)]
index=0
counter=0
while True:
@shurane
shurane / commands.clj
Created September 14, 2013 06:10
Yay, Overtone works with a local copy of SuperCollider on Windows. [lib.clj](https://github.com/overtone/overtone/blob/master/src/overtone/helpers/lib.clj#L345) was the culprit!
;; commands to run in the REPL
(use 'overtone.core)
(boot-external-server)
(definst foo [] (saw 220))
(foo)
(kill foo)
;; voila!
@shurane
shurane / disable_meetups_spam.js
Created September 28, 2013 03:00
Turns off mailing list, various types of meetup notifications, etc. Disables it for all the meetups you're signed up for, so be warned! I just put this code into the Javascript console for Chrome. Presumably you can do similar things in Firefox, IE, Opera, et al.
//http://www.meetup.com/account/comm/
$(".D_actions > li > a").each(function(){$(this).click();});
$(":checkbox").each(function(){$(this).prop('checked',false);});
$("div.input > label:last-child").each(function(){$(this).prop("checked",true)});
// I think this is needed for unsubscribing to mailing lists.
$("div.input > label:last-child > input").each(function(){$(this).prop("checked",true)});
//yes, I am a god. Spam-less meetup!
@shurane
shurane / project.clj
Created October 16, 2013 19:42
Running Light Table with "Clojure (remote nREPL)" on a Windows 7 x64 box. More information?
(defproject coderdojonyc-overtone "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main coderdojonyc.core
:dependencies [[org.clojure/clojure "1.5.1"]
[overtone "0.8.1"]])
@shurane
shurane / ALTERNATIVES
Last active December 28, 2015 22:39
wmctrl aero snap and other features.
Didn't know a handful of alternatives exist:
- https://github.com/ssokolow/quicktile
- https://github.com/lawl/opensnap
- http://bhepple.freeshell.org/scripts/half-screen
- http://code.google.com/p/pywo/
@shurane
shurane / gist:7687422
Created November 28, 2013 04:59
dynamic programming for great win. Problem: putting spaces back into a string of words.
obamasaysheplanstovetothebillinmanhattan
router
doesnt
suck
haha
this
is
more
words