Skip to content

Instantly share code, notes, and snippets.

View devkhan's full-sized avatar

Devesh Khandelwal devkhan

View GitHub Profile
@devkhan
devkhan / data_import.sh
Created March 9, 2015 07:22
Script for automating insertion of data from large CSV files into a MySQL database.
#!/bin/bash
#### This script is for automating the insertion of data from large csv files into a myql database.
MAINDIR=csvs/
LINES=$1
insertsql()
{
#### Execute mysql command.
@devkhan
devkhan / test.java
Created June 12, 2015 17:23
This is a test class done as an assignment for as part of the tasks given by AppAmplify team to me.
import java.io.*; // For Input-Output.
import java.security.MessageDigest; // For encryption.
import java.security.NoSuchAlgorithmException; // Algorithm Exception.
import java.util.Formatter; // Formatting generated key.
import java.util.Random; // Generating random appsflyerkey.
public class task
{
// appsflyerkey - private static member.
@devkhan
devkhan / C++11.sublime-build
Created July 22, 2015 12:26
Sublime Text C++11 Build System
{
"shell_cmd": "g++ -std=c++11 \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char const *argv[])
{
int n, m;
int **nm;
int *s, *q;
@devkhan
devkhan / boundary_fill.py
Created March 8, 2016 05:18
Boundary Fill Algorithm
#!/usr/bin/python2.7
import pygame
import sys, time
import math
pygame.init()
pygame.display.set_caption("Scan line Algorithm")
sys.setrecursionlimit(1000000000)
screen = pygame.display.set_mode((800,600))
@devkhan
devkhan / crawl.py
Created September 23, 2016 08:01
GitHub Email ID Crawler
import os
from github import Github
from github.AuthenticatedUser import AuthenticatedUser
g = Github("devkhan-test", "4cf28f314249c77ea1a64a9a8938b19cf6313e31")
file = open('output/indian_users.csv', 'w')
all_users = open('output/all_users.txt', 'w')
@devkhan
devkhan / CORS.xml
Last active October 21, 2016 19:27
AWS S3 Bucket Policy
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
@devkhan
devkhan / keybase.md
Created October 25, 2016 19:43
Keybase GitHub Proof

Keybase proof

I hereby claim:

To claim this, I am signing this object:

public class FUtility {
public FUtility() {}
public static boolean isEmpty(Object object) {
return object == null ? true : false;
}
public static boolean isNotEmpty(Object object) {
@devkhan
devkhan / mocha-before-and-beforeEach-lifecycles.js
Last active May 18, 2017 16:09 — forked from corywheeler/mocha-before-and-beforeEach-lifecycles.js
Show the order of execution of mocha's before and beforeEach hooks for each describe and each test
describe('highest level describe', function () {
before(function() {
console.log('This is the highest level before')
})
beforeEach(function() {
console.log('This is the highest level beforeEach')
})
it('This is the first highest level test', function() {
console.log('first highest level test')