Skip to content

Instantly share code, notes, and snippets.

Avatar
🎩
🐰

Juanito Fatas JuanitoFatas

🎩
🐰
View GitHub Profile
@JuanitoFatas
JuanitoFatas / build.yml
Last active Feb 26, 2020
Example GitHub Actions configurations for a Rails app
View build.yml
# .github/workflows/build.yml
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
@JuanitoFatas
JuanitoFatas / rails-diff.sublime-snippet
Created Apr 13, 2016
Generate rails old_version..new_version diff sublime snippet
View rails-diff.sublime-snippet
<snippet>
<content><![CDATA[
Upgrade rails from ${1:old_version} to ${2:new_version}.
- Updated: [rails](http://github.com/rails/rails), [${1:old_version}...${2:new_version}](https://github.com/rails/rails/compare/v${1:old_version}...v${2:new_version})
- Updated: actionmailer, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionmailer/CHANGELOG.md))
- Updated: actionpack, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionpack/CHANGELOG.md))
- Updated: actionview, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionview/CHANGELOG.md))
- Updated: activejob, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/activejob/CHANGELOG.md))
- Updated: activemodel, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/activemodel/CHANGELOG.md))
View hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@JuanitoFatas
JuanitoFatas / README.md
Created Dec 18, 2015 — forked from fnichol/README.md
A Common .ruby-version File For Ruby Projects
View README.md

A Common .ruby-version File For Ruby Projects

Background

I've been using this technique in most of my Ruby projects lately where Ruby versions are required:

  • Create .rbenv-version containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far...
  • Create .rvmrc (with rvm --create --rvmrc "1.9.3@myapp") and edit the environment_id= line to fetch the Ruby version from .rbenv-version (example below).

Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version.

@JuanitoFatas
JuanitoFatas / deppbot.md
Last active Dec 25, 2015
What is www.deppbot.com? Why bundle update?
View deppbot.md
@JuanitoFatas
JuanitoFatas / get_process_mem_repro.rb
Last active Aug 29, 2015
Ambiguous first argument warning of get_process_mem
View get_process_mem_repro.rb
require "get_process_mem"; GetProcessMem.new.mb
@JuanitoFatas
JuanitoFatas / heroku-time-zone.md
Last active Sep 4, 2015
Heroku Time Zone Rails 4
View heroku-time-zone.md

I have an date field. Used in two places. They are off by a day with each other when display.

 # 4/15
= local_time(user.create_date) # https://github.com/basecamp/local_time

# 4/16
= f.input :create_date, as: :string, input_html: { value: f.object.create_date && l(f.object.create_date, format: :long) }
@JuanitoFatas
JuanitoFatas / .travis.yml
Last active Jan 7, 2016
Sample travis.yml for RubyGems.
View .travis.yml
language: ruby
bundler_args: --retry=3 --jobs=3
cache: bundler
sudo: false
rvm:
- 2.3
- 2.2
- 2.1
- 2.0
- 1.9.3
You can’t perform that action at this time.