Skip to content

Instantly share code, notes, and snippets.

View revathskumar's full-sized avatar

Revath S Kumar revathskumar

View GitHub Profile
@trcarden
trcarden / gist:3295935
Created August 8, 2012 15:28
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@revathskumar
revathskumar / rails-boilerplate.md
Created September 11, 2012 18:39
My rails App boilerplate

My rails App boilerplate

  • Create Rails APP

      rails new blog -Td mysql --skip-bundle
    
  • Create .rvmrc

echo "rvm use 1.9.3-p194" >> .rvmrc

@vishnugopal
vishnugopal / rails-security.md
Created September 17, 2012 18:46
Rails Security Best Practices

Security Best Practices

  • Force SSL for Rails
  • Switch to encrypted_cookie_store
  • Set session expire_after to 10 minutes
  • Make sure that protect_from_forgery is set.
  • Make sure passenger & nginx runs as nobody or a less privileged user.
  • Double check uploads to make sure it is handling relative paths
  • Use attr_accessible where it makes sense
  • Filter all sensitive info from from logs
@jjulian
jjulian / stream.rb
Created September 18, 2012 12:42 — forked from davetroy/stream.rb
Capture tweets for a given lat/lon bounding box
#!/usr/bin/env ruby
$: << File.dirname(__FILE__)
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem name em-http-request
require 'yajl'
require 'yajl/json_gem'
class Streamer
@jonathantneal
jonathantneal / README.md
Created October 10, 2012 19:34
Responsive Elements

Responsive Elements

Responsive Elements is a proposal to extend the functionality of Media Queries to apply to Elements, allowing individual Elements to respond to local changes. Like existing Media Queries, these element media queries would consist of at least one expression that limits the scope of the selector; such as width, height, and aspect ratio.

Syntax

[selector]:media([query]) { [declarations] }

Examples

@nicdaCosta
nicdaCosta / Grep.js
Last active March 9, 2024 13:39
Basic function that searches / filters any object or function and returns matched properties.
/*
Grep.js
Author : Nic da Costa ( @nic_daCosta )
Created : 2012/11/14
Version : 0.2
(c) Nic da Costa
License : MIT, GPL licenses
Overview:
Basic function that searches / filters any object or function and returns matched properties.
@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@ivanvanderbyl
ivanvanderbyl / gist:4222308
Created December 6, 2012 06:55
Postgres 9.1 to 9.2 upgrade guide for Ubuntu 12.04
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
@cowboy
cowboy / call-invo-cursion.js
Last active March 30, 2023 01:59
JavaScript: call invo-cursion?
// OOP
console.log( 'OHAI'.blink() );
// Call invocation
console.log( String.prototype.blink.call('OHAI') );
// $ always makes things look awesome.
var $ = Function.prototype.call;
// Very explicit call invocation