Skip to content

Instantly share code, notes, and snippets.

Harit Himanshu harit-sunrun

Block or report user

Report or block harit-sunrun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@harit-sunrun
harit-sunrun / _.md
Created Jun 10, 2013
Tributary inlet
View _.md
View _.md
@harit-sunrun
harit-sunrun / flask blueprint.py
Created Mar 23, 2013
Registering multiple modules with flask blueprints. This will help to separate a project into multiple modules
View flask blueprint.py
# Project Structure
facebook/
runserver.py
feed/
__init__.py
views.py
chat/
__init__.py
views.py
@harit-sunrun
harit-sunrun / Sublime: Preferences.sublime-settings
Last active Dec 11, 2015
Make you Sublime look beautiful
View Sublime: Preferences.sublime-settings
Install this theme http://buymeasoda.github.com/soda-theme/
and http://www.levien.com/type/myfonts/Inconsolata.otf font
then make changes in your Sublime Text -> Preferences -> Settings - User as following
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"font_face": "Inconsolata-dz",
"font_size": 12.0,
"ignored_packages":
@harit-sunrun
harit-sunrun / PackageYourApp.xslt
Created Sep 18, 2012
Package Java Module as jar with dependencies included
View PackageYourApp.xslt
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
@harit-sunrun
harit-sunrun / MapReduceBaseTemplate.java
Created Aug 2, 2012
This is basic template you would usually need to write a Map reduce program. Most part would remain same, except Job related inputs and input/output type classes
View MapReduceBaseTemplate.java
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.Tool;
@harit-sunrun
harit-sunrun / CitationHistogram.java
Created Jul 30, 2012
Build the count of counts for cited patents from patent dataset
View CitationHistogram.java
package com.hadoop.patent;
/**
* This program collect data about how many times a patent has been cited
* input data - http://data.nber.org/patents/
* use the citation data set cite75_99.txt and the patent description data set apat63_99.txt.
*/
import org.apache.hadoop.conf.Configuration;
@harit-sunrun
harit-sunrun / InOrderPredecessor.java
Created Jun 27, 2012
Find inOrder successor and inOrder predecessor in binary search tree (BST)
View InOrderPredecessor.java
Node predecessor(Node node) {
if ((node.left == null) && (node.right==null)) {
return node;
}
if (node.right != null) {
return predecessor(node.right);
}
if (node.left != null) {
return predecessor(node.left);
}
@harit-sunrun
harit-sunrun / cdyne_address_verifier_advanced.py
Created May 9, 2012
Query CDYNE Advanced Address Verification web service using Python
View cdyne_address_verifier_advanced.py
"""
This Gist will show you how to verify a postal address using CDYNE advanced address verification web service
The following code assumes that you have a valid license key
Document Reference : http://pav3.cdyne.com/Pavservice.svc/help/operations/VerifyAddressAdvanced
"""
import json
import urllib2
import urllib
View ajax based suggestion
var ajaxSuggest = false
function submitSuggestion() {
url = '/suggest/'
ajaxSuggest = false;
if (window.XMLHttpRequest) { // if we're on Gecko (Firefox etc.), KHTML/WebKit (Safari/Konqueror) and IE7
ajaxSuggest = new XMLHttpRequest(); // create our new Ajax object
if (ajaxSuggest.overrideMimeType) { // older Mozilla-based browsers need some extra help
ajaxSuggest.overrideMimeType('text/xml');
}
}
You can’t perform that action at this time.