Skip to content

Instantly share code, notes, and snippets.

View intruxxer's full-sized avatar

Ali Fahmi intruxxer

  • PT SOLUSI INFOTECH SEMESTA INDONESIA
  • Jakarta
View GitHub Profile
@intruxxer
intruxxer / 0_reuse_code.js
Created October 4, 2013 02:57
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
@intruxxer
intruxxer / cancan.rb
Last active December 30, 2015 09:39 — forked from ryanb/cancan.rb
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user
if user.role? :admin
can :manage, :all
else
can :read, :all
/** Reinflates a compressed signature string:
resolution = a representation of the resolution in
pixels of the canvas which this signature will be drawn
e.g. {x:800,y:200}
*/
var inflateToJsonSignature = function (deflatedSig, resolution) {
var components = [],
modifier = 1,
compressWithResolution = /^(?:\[(\d+)x(\d+)\])?([\w\W]*)/,
parsedSigString = deflatedSig.match(compressWithResolution),

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

@intruxxer
intruxxer / data-modeling.md
Created January 23, 2014 00:03 — forked from pyk/active-record-migration-expert.md
Summary of Active Record-based RoR

become database modeling expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
@intruxxer
intruxxer / nginx.ini
Created April 13, 2014 12:41 — forked from rahul100885/nginx.conf
NGINX Conf file with SSL config
user deploy;
worker_processes 6;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.7;

Intro

These gists will help through the installation of PHP54, MySQL, and Postgres

Pre-Requisists

This assumes that you have already installed Homebrew (http://mxcl.github.io/homebrew/)

Installation

install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
@intruxxer
intruxxer / _service.md
Last active August 29, 2015 14:17 — forked from naholyr/_service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
# silver searcher
sudo apt-get install -y silversearcher-ag
# rabbitvcs
sudo add-apt-repository -y ppa:rabbitvcs/ppa
sudo apt-get update
sudo apt-get install -y rabbitvcs-nautilus3 rabbitvcs-cli rabbitvcs-core rabbitvcs-gedit
# couchbase
sudo apt-get install -y libssl0.9.8