Skip to content

Instantly share code, notes, and snippets.

View harry1989's full-sized avatar

Sriharsha Sistalam harry1989

View GitHub Profile
@harry1989
harry1989 / ngHyd
Last active August 29, 2015 13:57
ngHyderabad meetup 20140308
Agenda for the ngHyderabad meetup on 20140308
================================================
1. Introduction to modern web applications
* Current web stacks (ASP/JSP/Servlet)
* Bottleneck and scaling concerns with the existing stack
2. Overview of components of MEAN stack
* Explanation of each component of MEAN
* Advantages of having a single language stack
* Need for the API only servers
@harry1989
harry1989 / gist:70e6133f77d25d09a4f5
Last active August 29, 2015 14:01
Angular links
http://yearofmoo.com
http://thinkster.io
http://egghead.io
http://scotch.io/tag/angular-js
https://github.com/jmcunningham/AngularJS-Learning
@harry1989
harry1989 / gist:3e810d60789f8023fc91
Created October 21, 2014 19:53
Custom select dropdown
<span class="custom-select">
<span class="header">Recipient:</span>
<span class="option" data-option="normal">Normal</span>
<ul class="dropdown">
<li data-option="all">All: Email everyone</li>
<li data-option="normal">Normal: Everyone except pre-existing low traffic subscribers</li>
<li data-option="none">None: Do not email anyone</li>
@harry1989
harry1989 / proxy function
Last active August 29, 2015 14:11
HTML5 Instrumented code with Proxies and the navigation timing API
function getInstrumentedFn(fn){
return new Proxy(fn, {
apply: function(target, that, args){
//get the function name
var fName = fn.name || ('random function_' + parseInt(Math.random() * 1000));
//mark the starting of function.
performance.mark(fName + '_start');
var returnValue = fn.apply(that, args);
@harry1989
harry1989 / twitter-REPL
Created January 28, 2015 18:49
Twitter REPL
Description
This will be a REPL where user can query for twitter content within node REPL.
End result will be like this..
node twitter-repl
# Will get into REPL
javascript:(function() {
if(!window.your_bookmarklet) {
var doc = document,
js = doc.createElement('script');
js.type = 'text/javascript';
js.src = 'loader.js';
js.async = true;
@harry1989
harry1989 / birth_day_thank_you.py
Created May 25, 2012 13:03
Thanking people who wished for your birthday
# these needs to be entered
oath_token=''
birth_date=''
birth_day_messages = ["happy", "b'day","birthday", "bday"]
from facepy import GraphAPI
@harry1989
harry1989 / Gender pronoun git hook
Last active October 13, 2015 09:13
This git hook checks for the existence of gender pronouns in the commit message and aborts the commit if it finds one
#!/bin/env node
/**
* This scripts check of the existence of gender pronouns
* and aborts the commit if any of them are found
*
* Don't consider it as silly, because its really 'NOT!'.
* One of the core contributor of libuv had to depart since didn't
* accept a PR related to gender pronoun fix, so think
* carefully before using gender pronouns
/**
* This is a script to solve Yahoo bingo problem through
* websockets. http://yahoobingo.herokuapp.com/
*
* @author harry_sistalam
*/
var YAHOO_BINGO_URL = 'ws://yahoobingo.herokuapp.com';
var user_obj = {name : 'harry_sistalam',
email : 'sriharsha.sm@gmail.com',
@harry1989
harry1989 / gist:8422384
Last active January 3, 2016 06:28
Binding this in javascript.
When we have any asynchronus code that tries to access the object patterns, we run into issues with javascript `this` issue.
Ex:
var harry = { 'name': 'harry',
'greet' : function(){console.log('Hello ' + this.name)},
'print' : function(){
// using setTimeout, it can be any async function
setTimeout(this.greet, 1000); // this will fail!
}