Skip to content

Instantly share code, notes, and snippets.

View aashay's full-sized avatar

Aashay Desai aashay

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aashay on github.
  • I am aashay (https://keybase.io/aashay) on keybase.
  • I have a public key whose fingerprint is BF57 1D60 AAA6 4B45 DAA7 0B18 E2C4 0ECC DB81 0E99

To claim this, I am signing this object:

@aashay
aashay / gnome
Last active March 4, 2016 21:34
gnome
An unlocked laptop? Yippee! Hooray!
Today must be my lucky day!
I'm a kind of digital pickpocket,
So I'm really glad you forgot to lock it!
With VPN access I think I'll try
To get my hands on some PII!
A teapot here, a teapot there,
> var doc = new DOMParser().parseFromString('<type>Inkblot</type>', 'text/xml');
> #document
<type>​Inkblot</type>​
@aashay
aashay / 1 - server.js
Created September 22, 2012 22:49
socket.io 0.9.10 + socket.io-client 0.9.10 are not playing nice with xhr-polling...
/* 1. node server.js */
var io = require('socket.io').listen(1234);
io.configure(function () {
io.set('transports', ['xhr-polling']);
});
io.set('authorization', function(handshakeData, ack) {
return ack(null, true);
});
@aashay
aashay / cloudapp.rb
Created June 9, 2011 22:31
CloudApp script
#!/usr/bin/env ruby
#
# cloudapp
# Hacked together with duct tape, hopes, and dreams by Aashay Desai / @aashay
# Original by Zach Holman / @holman
#
# Uploads a file from the command line to CloudApp, drops it into your clipboard
#
# Example:
#
@aashay
aashay / Output from console
Created April 24, 2011 23:28
NowJS ClientGroup .on "bug"
24 Apr 16:27:32 - Client 8192318114452064 connected
Adding 8192318114452064. Counter is 0
24 Apr 16:27:39 - Initializing client with transport "websocket"
24 Apr 16:27:39 - Client 4147976329550147 connected
Adding 4147976329550147. Counter is 1
Adding 4147976329550147. Counter is 2
24 Apr 16:27:53 - Initializing client with transport "websocket"
24 Apr 16:27:53 - Client 015604767017066479 connected
Adding 015604767017066479. Counter is 3
Adding 015604767017066479. Counter is 4
@aashay
aashay / snippet.js
Created April 24, 2011 23:08
A NowJS implementation of an "addToChannel" method. This implementation is epic fail. For every N clients that connect, N "connect" events are fired. Not desirable at all.
everyone.now.addToChannel = function(channel){
//this client is trying to join a channel.
var group = nowjs.getGroup(channel);
group.on('connect', function(clientId){
console.log("CONNECT EVENT TRIGGERED for " + clientId);
if(!channelList[clientId]){
channelList[clientId] = [channel];
console.log("New channel array created for " + channel + ", added " + clientId);
}else{