Skip to content

Instantly share code, notes, and snippets.

View sairam's full-sized avatar
🏠
Working from home

Sai Ram Kunala sairam

🏠
Working from home
View GitHub Profile
@sairam
sairam / amazon.md
Created October 10, 2020 18:59 — forked from terabyte/amazon.md
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@sairam
sairam / 0_reuse_code.js
Created March 24, 2017 04:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sairam
sairam / screenshot.js
Last active April 16, 2016 04:17 — forked from n1k0/gist:1501173
PhantomJS: Capturing single dom elements as png files
// Usage:
// phantomjs --ssl-protocol=any screenshot.js "https://www.twitter.com/" twitter.png
// TODO: move '#topnav_wrapper' to selector or command line argument
// If element is not found, it will fetch the complete page
// Works with phontomjs 2.0 (does not work with 1.9)
// Ubuntu link for PhantomJS 2.0 - https://github.com/Pyppe/phantomjs2.0-ubuntu14.04x64
"use strict";
var page = require('webpage').create(),
@sairam
sairam / tsws
Last active September 6, 2015 17:03 — forked from dfletcher/tsws
Totally simple web server using Bash and netcat (nc)
#!/bin/bash
# --------------------------------
# Totally Simple Web Server (TSWS)
# --------------------------------
#
# (c) 2015 Dave Fletcher
# All Rights Reserved
#
# This is free and unencumbered software released into the public domain.
@sairam
sairam / dnsd.rb
Created January 18, 2013 14:45 — forked from peterc/dnsd.rb
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@sairam
sairam / gist:1209799
Created September 11, 2011 16:38 — forked from tinogomes/gist:1182499
credit card validation on ruby
# References
# http://en.wikipedia.org/wiki/Bank_card_number
# http://en.wikipedia.org/wiki/Luhn_algorithm
def valid_credit_card?(number)
number = number.to_s.gsub(/\D/, "")
return false unless valid_association?(number)
number.reverse!
#
# Copyright (c) 2010 Sairam Kunala
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#