Skip to content

Instantly share code, notes, and snippets.

View dahal's full-sized avatar
🌟
captableinc/captable

Puru Dahal dahal

🌟
captableinc/captable
View GitHub Profile
@dahal
dahal / flock.grid.html
Last active July 5, 2016 22:47
Styleguide
<div class="row">
<div class="one column">One</div>
<div class="eleven columns">Eleven</div>
</div>
<div class="row">
<div class="two columns">Two</div>
<div class="ten columns">Ten</div>
</div>
<div class="row">
<div class="three columns">Three</div>
@dahal
dahal / lambda-dynamo
Created May 4, 2016 04:32 — forked from markusklems/lambda-dynamo
Short aws lambda sample program that puts an item into dynamodb
// create an IAM Lambda role with access to dynamodb
// Launch Lambda in the same region as your dynamodb region
// (here: us-east-1)
// dynamodb table with hash key = user and range key = datetime
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
exports.handler = function(event, context) {
@dahal
dahal / buttons.html
Created April 16, 2016 00:16
Rent made Easy Styleguide
<!-- Anchors (links) -->
<a href="" class="button">Learn More</a>
<a href="" class="button">View All Features</a>
<!-- Buttons (actions) -->
<button type="button" class="success button">Save</button>
<button type="button" class="alert button">Delete</button>

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@dahal
dahal / PostalAddress.rb
Last active March 21, 2016 23:24 — forked from colinyoung/PostalAddress.rb
Parses a postal address into its components. (limited) i18n support and other features. inspired by this forrst post: http://forr.st/~zDa
#
# Most of the regexes here are from http://twitter.com/schuyler.
# They were posted on Forrst (http://forr.st/~zDa) as a public post,
# so I reworked them into a full class.
#
# Added:
# => (limited) international support -- should handle US/Canada and most of western europe
# => added :receipient, :postcode, and :country fields
# => state/province detection built-in
#atom-sync-settings
@dahal
dahal / zip_codes.csv
Created August 19, 2015 22:58
All US Zip Codes
We can't make this file beautiful and searchable because it's too large.
code,city,state,county,area_code,lat,lon
00501,Holtsville,NY,SUFFOLK,,40.922326,-72.637078
00544,Holtsville,NY,SUFFOLK,,40.922326,-72.637078
01001,Agawam,MA,HAMPDEN,,42.140549,-72.788661
01002,Amherst,MA,HAMPSHIRE,,42.367092,-72.464571
01003,Amherst,MA,HAMPSHIRE,,42.369562,-72.63599
01004,Amherst,MA,HAMPSHIRE,,42.384494,-72.513183
01005,Barre,MA,WORCESTER,,42.32916,-72.139465
01007,Belchertown,MA,HAMPSHIRE,,42.280267,-72.402056
01008,Blandford,MA,HAMPDEN,,42.177833,-72.958359
@dahal
dahal / sitemap.xml.erb
Last active August 29, 2015 14:27 — forked from ls-lukebowerman/sitemap.xml.erb
Sitemap (sitemaps.org) generator for Middleman
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) } %>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% pages.each do |p| %>
<url>
<loc>http://youdomain.com/<%=p.destination_path.gsub('/index.html','')%></loc>
<priority>0.7</priority>
</url>
<% end %>
</urlset>
@dahal
dahal / landing-pages.md
Last active August 29, 2015 14:26 — forked from revolunet/landing-pages.md
Beautiful SAAS landing pages
@dahal
dahal / harlem-shake.md
Last active August 29, 2015 14:25
Make your browser do harlem-shake

###Make your browser do harlem-shake..

1. Go to Google Chrome
2. Go to any website (works cool on facebook)
3. Right click anywhere -> Inspect Element
4. Click on the rightmost "Console" tab.
5. Copy paste the following * into the console.
6. Make sure the volume isn't too loud!
6. Press Enter.