Skip to content

Instantly share code, notes, and snippets.

View patelkunal's full-sized avatar
💭
I may be slow to respond.

Kunal patelkunal

💭
I may be slow to respond.
View GitHub Profile
@patelkunal
patelkunal / Anaconda.sublime-settings
Last active November 22, 2017 13:53
sublime-text-configs
{
"auto_formatting": true,
"autoformat_ignore":
[
"E309",
"E501"
],
"pep8_ignore":
[
"E309",
@patelkunal
patelkunal / free_email_provider_domains.txt
Last active August 29, 2015 14:28 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
@patelkunal
patelkunal / bootstrapper-py2-v1.py
Last active August 29, 2015 14:21
bootstrapper for writing code in code challanges
# all helper and main logic function goes here
def helper1():
pass
def helper2():
pass
def main(*inputs):
return result
task deploy(type: Copy, dependsOn: war) {
def tomcatHome = "$System.env.CATALINA_HOME"
def warName = "sample-app"
war.archiveName = "${warName}.war"
println "copying war to ${tomcatHome}"
from war
into "${tomcatHome}/webapps"
}
@patelkunal
patelkunal / git-update-commit-auther.sh
Last active August 29, 2015 14:15
How to fix git commit with wrong email address and name - before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "kppatel"
@patelkunal
patelkunal / java-format.xml
Created January 30, 2015 10:48
eclipse auto-format xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="nsug" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@patelkunal
patelkunal / bare-minimum-build.gradle
Last active August 29, 2015 14:13
build.gradle for simple java program - very specific usecase
apply plugin:'application'
mainClassName = "MainApp"
sourceSets.main.java.srcDirs = ['.']
run.dependsOn 'clean'
classes.mustRunAfter 'clean'
def count_anagrams(word):
from operator import mul
from math import factorial
return factorial(len(word)) / reduce(mul, [factorial(word.count(c)) for c in set(word)])
@patelkunal
patelkunal / config
Created October 15, 2014 18:17
sublime configs in .codeintel/config for virtualenv
{
"Python": {
"python": "./../bin/python",
"pythonExtraPaths": [
'./../lib/python2.7/site-packages',
]
}
}
@patelkunal
patelkunal / bash_prompt.sh
Last active August 29, 2015 14:07 — forked from insin/bash_prompt.sh
intelligent and beautiful bash prompt - git and virtualenv (python) aware.
#!/bin/bash
#
# AUTHER:
# Kunal
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository