Skip to content

Instantly share code, notes, and snippets.

View filipemonteiroth's full-sized avatar
🏠
Working from home

Filipe Monteiro filipemonteiroth

🏠
Working from home
View GitHub Profile
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@filipemonteiroth
filipemonteiroth / machine.js
Last active February 14, 2020 13:02
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@filipemonteiroth
filipemonteiroth / machine.js
Last active February 14, 2020 12:59
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@filipemonteiroth
filipemonteiroth / machine.js
Last active January 28, 2020 20:01
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@filipemonteiroth
filipemonteiroth / machine.js
Last active January 28, 2020 12:50
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@filipemonteiroth
filipemonteiroth / README.md
Created September 24, 2017 17:57
Flatten array in Ruby

That's a homebrewed flatten array method.

Tests

Run ruby flatten_spec.rb to make sure everything is working.

Minitest

I used ministest since that's a simple test and minitest is a built in lib.

class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
after_filter :cors
before_filter :cors_preflight_check
respond_to :json
private
# coding: utf-8
require 'rubygems'
require 'thinreports'
report = ThinReports::Report.new :layout => 'advanced_list'
report.layout.config.list(:advanced_list) do
# Define the variables used in list.
use_stores :row_count => 0,

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