Skip to content

Instantly share code, notes, and snippets.

View surendrans's full-sized avatar

Surendran surendrans

View GitHub Profile

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

require 'typhoeus'
require "json"
url1 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=dchelimsky&count=20"
url2 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=spritlesoftware&count=5"
url3 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=TouchVu&count=10"
url4 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ibmmobile&count=1"
hydra = Typhoeus::Hydra.new
download open ssl for windows: http://www.openssl.org/source/
Reference :
http://www.neilstuff.com/apache/apache2-ssl-windows.htm (for installation)
http://www.napcsweb.com/howto/rails/deployment/RailsWithApacheAndMongrel.pdf (for httpd.conf and ssl.conf & proxy fix)
Sample openssl confi (required to create key file)

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@surendrans
surendrans / clean_code.md
Created June 30, 2021 12:09 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules