Skip to content

Instantly share code, notes, and snippets.

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

Hemanth HM hemanth

🐜
🧘‍♂️
View GitHub Profile
@hemanth
hemanth / gist:1351269
Created November 9, 2011 12:12 — forked from paulirish/gist:603681
html5 and friends - a bigass bulleted list of features

HTML5 and friends.

A bigass bulleted list of features.

I commonly need to get a big list of all the stuff people think of when they think new and shiny these days. This list is for that.

I take a very inclusionist approach to it. 1

javascript APIs

  • Web Storage (localStorage, sessionStorage)
  • Web SQL Database
@hemanth
hemanth / wikipedia-remove-sopa-warning.user.js
Created January 18, 2012 08:55 — forked from mathiasbynens/wikipedia-remove-sopa-warning.user.js
Userscript that removes the SOPA overlay on English Wikipedia
// ==UserScript==
// @name Disable the SOPA overlay on English Wikipedia
// @author Mathias Bynens <http://mathiasbynens.be/>
// @match http://en.wikipedia.org/wiki/*
// ==/UserScript==
// http://mths.be/unsafewindow
window.unsafeWindow || (
unsafeWindow = (function() {
var el = document.createElement('p');
@hemanth
hemanth / js-best-practices.md
Created March 14, 2012 10:33 — forked from TheJase-Gist/js-best-practices.md
JavaScript best practices

JavaScript Best Practices

Code conventions

Closing/opening brackets

Although this isn't a problem in other languages, because of semicolon insertion, there could be problems if you don't place the bracket on the opening line:

// no:
function()
{
@hemanth
hemanth / index.md
Created March 16, 2012 08:57 — forked from ryankirkman/index.md
Math for Coders

Sets == Arrays of unique items

(A,B)

Ordered set.

[1, 2] != [2, 1]
@hemanth
hemanth / ruby-1.9-tips.rb
Created April 2, 2012 13:54 — forked from igrigorik/ruby-1.9-tips.rb
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@hemanth
hemanth / gist:2300258
Created April 4, 2012 10:41 — forked from eparreno/gist:2300165
About estimations
P = programmer; NP = non-programmer
NP: How long will it take?
P: It'll take as long as it takes.
NP: I don't understand. What does that mean?
P: When you tell me that the product is finished, it's done.
NP: You mean you can't estimate how long it'll take?
P: I can't estimate when you'll decide that it is done, therefore an
accurate prediction is impossible. From experience I know that a
project like this can take from three to nine months. A lot
@hemanth
hemanth / tree.md
Created April 24, 2012 15:14 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@hemanth
hemanth / capybara cheat sheet
Created May 1, 2012 04:35 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
http://norvig.com/21-days.html
http://developers.whatwg.org/
http://dev.opera.com/articles/view/1-introduction-to-the-web-standards-cur/#toc
Local Business connections
http://www.startupconnection.org/
http://stlouis.startupweekend.org/
Ruby/Heroku/Rails
http://www.nofluffjuststuff.com/blog/david_bock/2010/12/google_analytics_and_rails3
@hemanth
hemanth / drupal_to_rails_db_migration.thor
Created May 10, 2012 10:49 — forked from tonkla/drupal_to_rails_db_migration.thor
Thor script is used to migrate blog posts from Drupal to Rails
#! /usr/bin/env thor
require 'mysql2'
class Tonkla < Thor
desc 'migrate', 'migrate tonkla.com\'s blog posts from Drupal to Rails'
def migrate
db_from = Mysql2::Client.new(host: 'localhost', username: 'root', database: 'tonkla_com')
db_to = Mysql2::Client.new(host: 'localhost', username: 'root', database: 'klass_blog_development')
result = db_from.query('SELECT r.title, r.body, n.created AS created_at, r.timestamp AS updated_at