Skip to content

Instantly share code, notes, and snippets.

@alvinthen
alvinthen / README.md
Last active January 6, 2017 14:41
Rails minitest and guard setup

Add gems

group :test do
  gem 'rails-controller-testing', '0.1.1'
  gem 'minitest-reporters',       '1.1.9'
  gem 'guard',                    '2.13.0'
  gem 'guard-minitest',           '2.4.4'
end
@alvinthen
alvinthen / users.yml
Created November 22, 2016 19:13
Devise fixtures
one:
name: One
email: one@one.com
encrypted_password: <%= Devise::Encryptor.digest(User, 'password') %>
two:
name: Two
email: two@two.com
encrypted_password: <%= Devise::Encryptor.digest(User, 'password') %>
@alvinthen
alvinthen / README.md
Last active November 22, 2016 18:28
Add fields to devise model

Add name to User model

rails g migration AddNameToUser name:string

Add devise's registrations views to our project

rails g devise:views users -v registrations
@alvinthen
alvinthen / transform-symbol-member.js
Created November 12, 2016 16:26
Replace node_modules/babel-preset-react-native/transforms/transform-symbol-member.js to transform RxJS v5 on React Native
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*/
/* eslint-disable */
'use strict';
/*eslint consistent-return: 0*/
@alvinthen
alvinthen / opacity.txt
Created July 29, 2016 17:20
Convert opacity values in percentage to hexadecimal
0% - 00
1% - 03
2% - 05
3% - 08
4% - 0A
5% - 0D
6% - 0F
7% - 12
8% - 14
9% - 17