Skip to content

Instantly share code, notes, and snippets.

source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@brain64bit
brain64bit / learn.lua
Last active August 29, 2015 14:19 — forked from tylerneylon/learn.lua
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@brain64bit
brain64bit / readme.md
Last active September 19, 2015 08:39 — forked from jobsamuel/readme.md
Run NodeJS as a Service on Ubuntu 14.04 LTS

Run NodeJS as a Service on Ubuntu 14.04 LTS

With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?

  • Go to /etc/init/
  • $ sudo vim yourapp.conf
  • Paste script.conf
  • $ sudo start yourapp
  • And when you wanna kill the process $ sudo stop yourapp
@brain64bit
brain64bit / iterm2.md
Created September 28, 2015 17:50
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@brain64bit
brain64bit / links.textile
Created October 15, 2015 07:40 — forked from lucashungaro/links.textile
Links de referência utilizados em minha palestra
@brain64bit
brain64bit / gist:e60d6791acfd14d585ec
Created February 3, 2016 03:21 — forked from remy/gist:350433
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@brain64bit
brain64bit / README.md
Created February 4, 2016 09:13 — forked from quiver/README.md
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo
@brain64bit
brain64bit / README.md
Last active March 12, 2016 15:45 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@brain64bit
brain64bit / Selenium Cheat Sheet.md
Last active June 22, 2016 03:26 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby
require "rspec/core/formatters/base_text_formatter"
require 'headless'
require 'fileutils'
class AcceptanceVideoFormatter < RSpec::Core::Formatters::BaseTextFormatter
def initialize(output)
@headless = Headless.new(
video: {
nomouse: true,