Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Madhur Ahuja madhur

View GitHub Profile
View calibretheme.css
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
View Problem3.java
import java.util.*;
public class Problem3 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int testCases = scan.nextInt();
List<Integer> numbers = new ArrayList<>();
for ( int i =1; i<=testCases; ++i) {
@madhur
madhur / delta.java
Created Oct 26, 2017
DeltaEncoding
View delta.java
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String args[] ) throws Exception {
Scanner scan = new Scanner(System.in);
View test.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by madhur on 15 Aug.
*/
public class IntegerArrayFlattener {
@madhur
madhur / clone.py
Created Feb 12, 2017
Bulk clone github repositories (including private)
View clone.py
import requests
import json
import subprocess
GITHUB_ORGANIZATION = "madhur"
ACCESS_TOKEN=""
CLONE_DIR="./"
r = requests.get("https://api.github.com/orgs/" + GITHUB_ORGANIZATION + "/repos?per_page=200&access_token=" + ACCESS_TOKEN)
@madhur
madhur / iptables_rules.sh
Created Dec 3, 2016 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
View iptables_rules.sh
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
View pubnub_speed.js
var amqp = require('amqplib');
var http = require('http');
var PUBNUB = require('pubnub');
pubnub = PUBNUB({
publish_key: 'demo',
subscribe_key: 'demo'
});
@madhur
madhur / centos_python_env_setup
Created May 24, 2016 — forked from hangtwenty/centos_python_env_setup
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
View centos_python_env_setup
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
View pubnub.js
var amqp = require('amqplib');
var http = require('http');
var PUBNUB = require('pubnub');
pubnub = PUBNUB({
publish_key: 'demo',
subscribe_key: 'demo'
});
View spreadsheet.py
import requests
import csv
import io
headers={}
headers["User-Agent"]= "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
headers["DNT"]= "1"
headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
headers["Accept-Encoding"] = "deflate"
headers["Accept-Language"]= "en-US,en;q=0.5"
You can’t perform that action at this time.