Skip to content

Instantly share code, notes, and snippets.

Avatar

Amit Upadhyay amitu

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am amitu on github.
  • I am amitu (https://keybase.io/amitu) on keybase.
  • I have a public key whose fingerprint is 0573 B4C1 B82D 985B C0A0 4799 CD50 23F8 FC63 BFB9

To claim this, I am signing this object:

View .gitignore
eventsource
go-eventsource
client/client
@amitu
amitu / net.http.diff
Last active Aug 29, 2015
Optionally not creating go routines on HTTP requests: https://groups.google.com/forum/#!topic/golang-nuts/iwCz_pqu8R4
View net.http.diff
diff -r ceb13960d05b src/pkg/net/http/server.go
--- a/src/pkg/net/http/server.go Thu Mar 13 13:25:59 2014 +0400
+++ b/src/pkg/net/http/server.go Thu Jul 03 21:48:41 2014 +0530
@@ -1615,6 +1615,8 @@
ErrorLog *log.Logger
disableKeepAlives int32 // accessed atomically.
+
+ DisableGoRoutines bool
}
View adb.py
#!/usr/bin/env python
from path import path
from struct import unpack
from collections import namedtuple
import stat, os
USBDeviceDescriptor = namedtuple(
"USBDeviceDescriptor", " ".join(
[
@amitu
amitu / output_stripper.py
Created Jul 15, 2014
Remove output from iPython notebook files.
View output_stripper.py
from IPython.nbformat import current
import io
from os import remove, rename
from shutil import copyfile
from subprocess import Popen
from sys import argv
for filename in argv[1:]:
# Backup the current file
backup_filename = filename + ".backup"
View gist:2477cec5e4c4e060cf4d
Verifying that +amitu is my openname (Bitcoin username). https://onename.io/amitu
@amitu
amitu / Makefile
Created Feb 10, 2015
how to do static files in django/s3
View Makefile
CURRENT=${shell git rev-parse HEAD}
sync:
./build.sh min
s3cmd sync proj/staticfiles/admin/ s3://static.proj.com/admin/
s3cmd sync proj/staticfiles/latest/ s3://static.proj.com/${CURRENT}/
@amitu
amitu / ldap2unix.go
Last active Aug 29, 2015
LDAP timestamp to Unix Epoch
View ldap2unix.go
package main
import (
"fmt"
"os"
"time"
)
func main() {
if len(os.Args) != 2 {
View find.go
// Package bench is a package which contains
// programs of Go Benchmark Competition.
package bench
import (
"bufio"
"errors"
"fmt"
"os"
"strings"
View gist:044f1e6eb3495e94ebb2
var webrtc = require('..');
var RTCPeerConnection = webrtc.RTCPeerConnection;
var RTCSessionDescription = webrtc.RTCSessionDescription;
var RTCIceCandidate = webrtc.RTCIceCandidate;
var pc1 = new RTCPeerConnection();
var pc2 = new RTCPeerConnection();
var d = "";
You can’t perform that action at this time.