Skip to content

Instantly share code, notes, and snippets.

@alobato
alobato / rails_resources.md
Created May 2, 2014 22:54 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
alias reload="source ~/.bash_profile"
alias lsc="ls -G"
alias ll="ls -Glahs"
alias ls="ls -GF"
alias showip="ifconfig | grep broadcast | sed 's/.*inet \(.*\) netmask.*/\1/'"
alias myip="curl whatismyip.nodejitsu.com/index.txt" # alias myip="wget http://myipaddress.com -O - -o /dev/null |grep '<b>'| sed -E 's/<p><b>//g'|sed -E 's/<\/b>//g'"
alias cleanup="sudo rm -rf /private/var/log/asl/*"
alias xmlget="curl -X GET -H 'Accept: application/xml'"
alias jsonget="curl -X GET -H 'Accept: application/json'"
alias xmlpost="curl -X POST -H 'Accept: application/xml'"
QSemaphore semaphorePlacedActivity;
QSemaphore finishedSemaphore;
extern Timetable gt;
static bool swappedActivities[MAX_ACTIVITIES];
static bool foundGoodSwap;
# use the socket we configured in our unicorn.rb
upstream unicorn_appname {
server unix:/tmp/unicorn.appname.sock fail_timeout=0;
}
server {
listen 80;
server_name appname.com.br;
rewrite ^/(.*) http://www.appname.com.br/$1 permanent;
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
div {
display: none;
width: 100px; height: 100px;
$('.item').each(function(i) {
$(this).append('<a style="position:absolute;top:0;right:0" href="' + '/x/a/' + $(this).data('id') + '">X</a>')
});
server {
server_name domain;
rewrite ^/(.*) http://www.domain/$1 permanent;
access_log /dev/null;
error_log /dev/null;
}
server {
server_name domain;
root /home/deployer/apps/appname/current;
@alobato
alobato / php_run.sh
Last active August 29, 2015 14:17
php_run.sh
#!/bin/bash
FASTCGI_USER=deployer
FASTCGI_GROUP=deployer
ADDRESS=127.0.0.1
PORT=9000
PIDFILE=/home/deployer/.php/appname/php-fastcgi.pid
CHILDREN=3
PHP5=/usr/bin/php5-cgi
@alobato
alobato / php_init.sh
Last active August 29, 2015 14:17
php_init.sh
#!/bin/bash
# https://www.linode.com/docs/websites/nginx/nginx-and-phpfastcgi-on-ubuntu-10-04-lts-lucid
PHP_SCRIPT=/home/deployer/.php/appname/run.sh
FASTCGI_USER=deployer
FASTCGI_GROUP=deployer
PID_DIR=/home/deployer/.php/appname
PID_FILE=/home/deployer/.php/appname/php-fastcgi.pid
RET_VAL=0
@alobato
alobato / nginx_php_cache.conf
Created March 24, 2015 16:39
nginx_php_cache.conf
server {
server_name domain;
rewrite ^/(.*) http://www.domain/$1 permanent;
access_log /dev/null;
error_log /dev/null;
}
server {
server_name www.domain;
root /home/deployer/apps/appname/current;