Skip to content

Instantly share code, notes, and snippets.

@fnando
fnando / application.css.scss
Last active December 19, 2015 09:18
Loading CSS through the asset pipeline
/*
*= require vendor/normalize
*= require_tree ./vendor
*/
@import "bourbon";
@import "core/settings";
@import "core/base";
@import "core/**/*";
Autotest.add_hook :initialize do |at|
%w[.git vendor db log tmp .DS_store Gemfile.lock coverage].each do |exception|
at.add_exception(exception)
end
end
@fnando
fnando / giffy
Last active July 1, 2020 02:30
Export video files as GIF
#!/usr/bin/env bash
if [[ ! -f "$1" ]]; then
echo "=> Movie file not found"
exit 1
fi
tempfile=/tmp/output.gif
rm -f $tempfile
@fnando
fnando / sample_spec.rb
Created May 29, 2013 10:44
RSpec 2.14.0.rc1 introduces message expectation through the expect method. To be honest, I still prefer the classic syntax in this case, since it's easier to format the code in multiple lines (readability <3).
# Classic syntax
some_object
.should_receive(:some_method)
.with(:a, :b, :c)
.and_return(:d)
# expect syntax
expect(some_object).to receive(:some_method).with(:a, :b, :c).and_return(:d)
@fnando
fnando / Vagrantfile
Created May 20, 2013 23:43
My Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hellobits"
config.vm.box_url = "http://hellobits.com/vagrant/hellobits.box"
config.vm.synced_folder ".", "/Projects", id: "vagrant-root"
# config.vm.network :private_network, ip: "192.168.50.2"
forward_port = ->(guest, host = guest) do
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hellobits"
config.vm.box_url = "http://hellobits.com/vagrant/hellobits.box"
config.vm.synced_folder ".", "/Projects", id: "vagrant-root"
# config.vm.network :private_network, ip: "192.168.50.2"
forward_port = ->(guest, host = guest) do
{
"cmd": ["C:/Program Files/nodejs/node.exe", "$file"],
"selector": "source.js"
}
@fnando
fnando / Gruntfile.js
Created May 3, 2013 23:27
A sample Grunt configuration file.
module.exports = function(grunt) {
var config = {};
// Concat ================================
config.concat = {
options: {
separator: ";"
},
dist: {
src: [
@fnando
fnando / README.md
Last active December 16, 2015 19:39
Em julho estou pensando em fazer uma série de micro-workshops. Se você quer sugerir um tema, é só mandar um comentário.
  • Integrando com o PagSeguro
  • Integrando com o Moip
  • Integrando com o Paypal
  • Executando background jobs no Ruby on Rails
  • Organizando o CSS com Sass
  • Deployment com Capistrano, NGINX e Unicorn
  • Autenticando com OAuth pelo Twitter, Facebook e Github
  • Entendendo os protocolos do Rails
  • Começando com Ember.js
  • Nandificando o Sinatra (Fazer uma implementação do Sinatra à partir do Rack)
Autotest.add_hook :initialize do |at|
%w[.git vendor db log tmp .DS_store Gemfile.lock coverage].each do |exception|
at.add_exception(exception)
end
end