Skip to content

Instantly share code, notes, and snippets.

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,
@brain64bit
brain64bit / Selenium Cheat Sheet.md
Last active June 22, 2016 03:26 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby
@brain64bit
brain64bit / gist:ede6789a0cca2b0804922630984d356a
Created June 2, 2016 12:11
How to debug why linux process being killed
sudo tail -f /var/log/kern.log
run the process who will killed
http://stackoverflow.com/questions/726690/who-killed-my-process-and-why
@brain64bit
brain64bit / README.md
Last active March 12, 2016 15:45 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@brain64bit
brain64bit / yosemite-gem-problem.md
Last active March 11, 2016 17:30
Ruby gems installation problem at Mac OSX Yosemite 10.11

Workaround for gems that cannot be installed easily on macosx yosemite

nokogiri 1.6.6.2

  • make sure nokogiri installed successfully
gem install nokogiri -v '1.6.6.2' -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
  • add build config for bundle
bundle config build.nokogiri --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
@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 / 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 / links.textile
Created October 15, 2015 07:40 — forked from lucashungaro/links.textile
Links de referência utilizados em minha palestra
@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 / 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