Skip to content

Instantly share code, notes, and snippets.

View hemanth's full-sized avatar
🐜
🧘‍♂️

Hemanth HM hemanth

🐜
🧘‍♂️
View GitHub Profile
@hemanth
hemanth / ebooks.md
Created July 24, 2012 13:56 — forked from roidrage/ebooks.md
Self-published and awesome
@hemanth
hemanth / array.extensions.md
Created July 21, 2012 11:34 — forked from rwaldron/array.extensions.md
Array.from and Array.of
@hemanth
hemanth / gist:3154685
Created July 21, 2012 05:19
Lazy Programmer

Lazy Programmer

A Lazy programming is the best hire you can make. Lazy programmers are ideal for a startup. They will be the reason a project will be successful.

  1. Lazy programmers hate manual work. They will always automate anything that needs to be done manually. This creates a smarter solution which is less error-prone to the human action.

  2. Lazy programmers hate talking to others. They will produce better code so that it works in all cases to avoid being questioned by others on their work.

@hemanth
hemanth / nodeconf_2012.md
Created July 21, 2012 05:17 — forked from savage69kr/nodeconf_2012.md
a list of slides from nodeconf 2012
@hemanth
hemanth / python33.txt
Created July 16, 2012 13:17 — forked from hawkz/python33.txt
Python in 33 sentences
print - lets you output numbers and characters to the console.
if - let's you choose which statements are executed if an expression is true
else - denotes the statements that execute if the expression isn't true
elif - let's you combine if statements
while - is a way of repeating statements in a loop until an expression is false.
break - is a way to jump out of the statement flow of a loop.
continue - let's you skip a cycle of the flow without ending it.
for - is used to iterate over items of a collection in the order they appear in a container

I love Coffeescript, but write Javascript

This is an example of why even though I love coffeescript, I still frequently write code in raw javascript.

This is the coffeescript I originally had:

pairs = []
@hemanth
hemanth / u.js
Created July 13, 2012 09:43 — forked from kputnam/u.js
Functional combinators in JavaScript
var u = (function() {
var id = function(x) { return x; }
, single = function(x) { return [x]; }
, constant = function(x) { return function() { return x; }}
, $ = function(f, x) { return f(x); };
var curried = function(f, n, args) {
return (args.length >= n)
? f.apply(null, args)
: function() { return curried(f, n, args.concat(slice(arguments))); }; };
@hemanth
hemanth / readme2ghpage.rb
Created July 13, 2012 04:59 — forked from camagu/readme2ghpage.rb
Convert your README.md on master to index.md on gh-pages
#!/usr/bin/env ruby
# checkout the readme from the master branch
`git checkout gh-pages; git checkout master README.md`
path = `pwd`.gsub(/\n/, "")
readme_path = File.join(path, "README.md")
index_path = File.join(path, "index.md")
# write the index readme file
@hemanth
hemanth / gist:3098203
Created July 12, 2012 13:48 — forked from rmurphey/gist:3086328
What's wrong with Netmag's "Optimize your JavaScript" post

What's wrong with Netmag's "Optimize your JavaScript" post

Update: The original post on Netmag has been updated since this was written.

I tweeted earlier that this should be retracted. Generally, these performance-related articles are essentially little more than linkbait -- there are perhaps an infinite number of things you should do to improve a page's performance before worrying about the purported perf hit of multiplication vs. division -- but this post went further than most in this genre: it offered patently inaccurate and misleading advice.

Here are a few examples, assembled by some people who actually know what they're talking about (largely Rick Waldron and Ben Alman, with some help from myself and several others from the place that shall be unnamed).

Things that are just plain wrong