Skip to content

Instantly share code, notes, and snippets.

@pandurang90
pandurang90 / 0_reuse_code.js
Created June 1, 2014 02:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pandurang90
pandurang90 / nginx
Last active August 29, 2015 14:02
nginx configure
# HTTPS server
#
server {
listen 443;
server_name server_url;
index index.html index.htm;
root /home/deploy/cingo/public;
ssl on;
ssl_certificate path/to/www.example.org.crt;
ssl_certificate_key path/to/www.example.org.key;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDQK9kjyPaSHRZIkH7SwQ4WjMJkUSgKPq2pg8CVZeUreuBE0jotknkO1EmSC5zQDtnJLtUYOt08ckgFN5ucVWrceNhTXwLmXZMbSbZHvU7R6luSXyJ/s6zK6hl6MgqP3Z4wmCtSwuaqABC4PTd3X8Hd3wwjfeQXUT6Onpcz3vUS7SkkhHS1mOJvhW4QcPmD8JNolC9yxue2YAEtEArZWFpIlTSu9J3sMea0nK9C3thP9jRoQRPIh8ATQQRkL5Vqeq061FONAHQrkg7phws86HWnTcLxFeJc+fwAmETvmPk41w2zX2Z/Uu2/hTw1XgBqIr/IUSdHZMQuc9Wh7T0v2uH pandurang.plw@gmail.com
=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')
@pandurang90
pandurang90 / introrx.md
Last active August 29, 2015 14:20 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@pandurang90
pandurang90 / multiple_ssh_setting.md
Created October 12, 2015 11:01 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@pandurang90
pandurang90 / change_default_message.js
Created December 1, 2015 10:40 — forked from 0xqd/change_default_message.js
jQuery validation cheatsheet
// Change the default message of jquery validation
jQuery.extend(jQuery.validator.messages, {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger
=======================================================================
EC2 Setup
---------
1 Launch New ec2 instance - ami-1634de7f
2 Create elastic IP [ELASTIC_IP] and associate it with instance
3 go to domain registrar DNS settings, @ and www to ELASTIC_IP
4 set the `:host` in `config/deploy.rb` to ELASTIC_IP
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment: