Skip to content

Instantly share code, notes, and snippets.

View sengupta's full-sized avatar

Aditya Sengupta sengupta

View GitHub Profile
@ramanathanrv
ramanathanrv / gateway_routing_logic_samples
Last active February 15, 2017 17:35
Routing Logic for choosing the best gateway to handle your transaction
// WARNING: This code is a sample to test your logic of gateway priority. This is NOT to be used as such.
def order = [order_id: "ord_id", amount: 1000.00, udf1:"web", udf2: "desktop", gateway_id: 2]
def txn = [txn_id: "txn_id", express_checkout: true, add_to_locker: false ]
def payment = [card_isin: "524368", card_issuer: "HDFC Bank", card_type: "CREDIT"]
def setGatewayPriority = { gateways ->
println "priority: " + gateways;
}
@acolyer
acolyer / service-checklist.md
Last active July 10, 2024 05:13
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 25, 2024 09:09
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@drusepth
drusepth / reader.html
Created March 7, 2014 08:32
Lets you read fluid text at 2-3x your normal speed using ORPs
<html>
<head>
<title>FaS Reader</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Fast as Sanic Reader
var left = $('<span />').attr('id', 'left'),
@sengupta
sengupta / LICENSE.txt
Last active December 17, 2022 03:34
Sample Webhook Receiver to test Instamojo's (or any web service's) webhook feature.
Copyright (c) 2014, Instamojo, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@sengupta
sengupta / README.md
Created March 9, 2012 14:50
Reliance Netconnect Plus Prepaid Balance Checker

Reliance Netconnect Plus Prepaid Balance Checker

This is a small shell script that checks your Reliance Netconnect Prepaid account balance and emails it to a designated email address.

The Netconnect number and email address are to be saved in a file called .netconnectrc in your home directory with the following variables:

netconnect_number="1234567890"
email_addresses="comma separated list of email addresses"
@sengupta
sengupta / LICENSE.txt
Created January 16, 2012 18:46
Email Scraper
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
@apnerve
apnerve / like
Created December 11, 2011 16:48
Facebook like bookmarklet
javascript:(function(){try{var%20url=encodeURIComponent(location.href);var%20ifr=document.createElement('iframe');ifr.style.position='absolute';ifr.style.top=10+'px';ifr.style.left=10+'px';ifr.style.width=450+'px';ifr.style.height=100+'px';ifr.style.border='none';ifr.src='http://www.facebook.com/plugins/like.php?href='+url+'&show_faces=true&width=450&action=like&colorscheme=light';ifr.scrolling='no';ifr.frameborder=0;document.getElementsByTagName('body')[0].appendChild(ifr);}catch(e){}})();
@GaelVaroquaux
GaelVaroquaux / lighting_talk.rst
Created December 5, 2011 10:29
Bootstrapping a SciPy-related community project

Bootstrapping a SciPy-related community project

This document is a lightning talk: it only gives pointers, you need to Google and read references

Goal

@stefanv
stefanv / sparks.py
Created November 17, 2011 00:25
Command line sparks in Python
#!/usr/bin/python
# coding=utf-8
# Python version of Zach Holman's "spark"
# https://github.com/holman/spark
# by Stefan van der Walt <stefan@sun.ac.za>
"""
USAGE: