Skip to content

Instantly share code, notes, and snippets.

digraph {
node [shape=box, fontname=helvetica, fontsize=14]
edge [fontname=helvetica, fontsize=12]
rankdir=TB; pad=0.5; dpi=80;
// happy path
subgraph cluster_0 {
color=black; label="typical path"; fontname=helvetica

Keybase proof

I hereby claim:

  • I am bhattisatish on github.
  • I am satish (https://keybase.io/satish) on keybase.
  • I have a public key ASBBXKUSguu_TWoygpZwpYDomv53tobfK14YUKWlbueSZQo

To claim this, I am signing this object:

@bhattisatish
bhattisatish / CertiRakefile
Created August 13, 2014 15:57
SSL Generation
desc "Generate a new key"
task :gen_key do
domain = get_env(:domain)
filename = "#{domain}.key"
next if File.exists? filename
`openssl genrsa -out #{filename} 2048`
end
desc "Generate a new CSR"
@bhattisatish
bhattisatish / EDI_Formatter
Created July 12, 2014 03:21
EDI Custom Plugin for Notepad++
<NotepadPlus>
<UserLang name="X12" ext="">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+"></Keywords>
float[] pos = new float[50];
void setup(){
size(600,600, P3D);
for(int i = 0; i < pos.length; i++){
pos[i] = -100*i;
}
noFill();
}
void draw(){
background(92);
@bhattisatish
bhattisatish / pascal-nosenzo-v17.pde
Last active August 29, 2015 13:58
Processing file for generating ...
/*Original Source: http://www.reddit.com/r/processing/comments/221krp/thoughts_on_how_to_make_this/cginzbn */
float a;
void setup() {
size(800, 800);
rectMode(CENTER);
}
void draw() {
translate(width/2, height*0.4);
@bhattisatish
bhattisatish / gist:4378255
Created December 26, 2012 05:56
Is a function a constructor or not? Original src https://github.com/Benvie/Node.js-Ultra-REPL
function isConstructor(o){
return typeof o === 'function' // per ES spec any callable is typed 'function'
&& o.prototype != null // filter out absent prototypes
&& (typeof o.prototype === 'object' // filter out primitive prototypes
|| typeof o.prototype === 'function')
&& Object.getPrototypeOf(o) !== Object.prototype // filter out non-constructable DOM interfaces
&& Object.getOwnPropertyNames(o.prototype).length > // ensure the prototype has at least one property
{}.hasOwnProperty.call(o.prototype, 'constructor'); // ...besides 'constructor'
}
@bhattisatish
bhattisatish / gist:4378251
Created December 26, 2012 05:56
Is a function a constructor or not? Original src https://github.com/Benvie/Node.js-Ultra-REPL
function isConstructor(o){
return typeof o === 'function' // per ES spec any callable is typed 'function'
&& o.prototype != null // filter out absent prototypes
&& (typeof o.prototype === 'object' // filter out primitive prototypes
|| typeof o.prototype === 'function')
&& Object.getPrototypeOf(o) !== Object.prototype // filter out non-constructable DOM interfaces
&& Object.getOwnPropertyNames(o.prototype).length > // ensure the prototype has at least one property
{}.hasOwnProperty.call(o.prototype, 'constructor'); // ...besides 'constructor'
}
@bhattisatish
bhattisatish / hackathon_checklist.txt
Created December 10, 2012 20:29
Running your own hackathon?
# Build around a theme
Ensure that you have a theme around the hackathon. It should be generic enough for people to have freedom on what they want to build, but specific enough for people to focus on. There is nothing like a goal oriented hackathon. The energy that can build up is amazing.
If you are running it as an internal event, then make sure you brainstorm/vote on the theme by getting the whole org involved.
Organize the event for at least 2-3 days.Though I have seen 1 night events, rarely anything comes out of those.
If it's an internal event, avoid conducting it over a weekend, however tempting.
# Logistics
Take care of the food! Three meals, and maybe couple of snack periods. If you can afford it, try to have a full pantry for snacks.
@bhattisatish
bhattisatish / call_rate_limiter
Created October 15, 2012 18:03
Limiting JS Function calls to avoid frequent calls. Origin http://ryhan.org/post/33374611308/limiting-function-calls
//// some function
//var foo = function ( data ){ console.log(data); }
//// identical to foo(), except can only be called once every 100ms.
//var limitedFoo = trickle(foo, 100);
////
function trickle( fun , waitLength )
{
var lastCalledAt = 0,
context = this;