Skip to content

Instantly share code, notes, and snippets.

@pkmishra
pkmishra / introrx.md
Created January 9, 2018 06:57 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Keybase proof

I hereby claim:

  • I am pkmishra on github.
  • I am pkm (https://keybase.io/pkm) on keybase.
  • I have a public key ASDCGAyg-EB5rF_2mFx9f2Pex_BxGnoJWF527qNCMw73tQo

To claim this, I am signing this object:

require 'rubygems'
require 'net/ldap'
time = Time.new
p time.localtime
ldap = Net::LDAP.new :host => '<hostname>',
:port => 636,
:auth => {
:method => :simple,
{
"messageId":9999,
"importToken":"the-import-token",
"getterId":"the-unique-getter-job-id",
"urls":[
"file.relay.gracenote.com?id=123",
"file.relay.gracenote.com?id=124",
"file.relay.gracenote.com?id=125"
]
}
@pkmishra
pkmishra / walls.py
Created October 30, 2013 09:21 — forked from igor47/walls.py
#!/usr/bin/python
def water(levels, second_pass = False):
# sanity check
if len(levels) < 2:
return 0
# state machine
filling = False
h = 0
@pkmishra
pkmishra / utilities.js
Created June 24, 2013 03:29
Collection of js utilities
//Script to find elements with duplicate ids in html dom
$('[id]').each(function(){
var ids = $('[id="'+this.id+'"]');
if(ids.length>1 && ids[0]==this)
console.warn('Multiple IDs #'+this.id);
});
package com.mojolly.backchat
package redis
package resque
import com.mojolly.backchat.redis.resque.Resque.{ResqueWorkerActor}
import net.liftweb.json._
import JsonAST._
import JsonDSL._
import java.net.InetAddress
import com.redis.ds.{ RedisDeque, RedisDequeClient }
@pkmishra
pkmishra / settings.py
Last active December 15, 2015 03:19
Config settings for Scrapy.
# More comprehensive list can be found at
# http://techpatterns.com/forums/about304.html
USER_AGENT_LIST = [
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7',
'Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0) Gecko/16.0 Firefox/16.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10'
]
DOWNLOADER_MIDDLEWARES = {
'myproject.middlewares.RandomUserAgentMiddleware': 400,
'myproject.middlewares.ProxyMiddleware': 410,