Skip to content

Instantly share code, notes, and snippets.

@vmlinz
vmlinz / sshtest.yml
Created February 28, 2016 16:18
Ansible book to test ssh forwarding in trellis
---
- hosts: web:&{{ env }}
tasks:
- name: Test that git ssh connection is working.
command: ssh -T [email protected]
@vmlinz
vmlinz / gist:80bbf5aec7cbb452e014
Created February 10, 2016 07:18 — forked from geekdada/gist:53eb32e1032325a2ee60
My Chrome Extensions
1Password: Password Manager and Secure Wallet https://agilebits.com/onepassword
Adblock Plus https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpkdaibdccddilifddb
Alisec Extension https://chrome.google.com/webstore/detail/lapoiohkeidniicbalnfmakkbnpejgbi
AngularJS Batarang https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk
Awesome Screenshot: Capture & Annotate https://chrome.google.com/webstore/detail/alelhddbbhepgpmgidjdcjakblofbmce
@vmlinz
vmlinz / 0_reuse_code.js
Created February 10, 2016 07:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vmlinz
vmlinz / picture_uploader.rb
Created January 16, 2016 11:45
PictureUploader with carrierwave and qiniu
# encoding: utf-8
class PictureUploader < CarrierWave::Uploader::Base
UPLOADER_IMAGE_VERSION_NAMES = %w( 320x240 480x320 640 800 )
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
@vmlinz
vmlinz / rails_template_readme.md
Created January 6, 2016 04:00
rails template and best practices

CODESCRUM RAILS TEMPLATE

A base template for deploying Rails applications.

ESSENTIAL VERSIONS

The following versions are very important to keep in mind. We've done this because we think that the Ruby, Rails and ORM type and versions are the ones that apply the most constraints to a starter template.

  • Ruby 2.2.0
@vmlinz
vmlinz / link.txt
Last active September 7, 2016 23:09
Deploy hexo site with travis
@vmlinz
vmlinz / prepare_eventmachine.sh
Last active December 24, 2015 02:53
Install eventmachine gem with brew installed open ssl
bundle config build.eventmachine --with-cppflags=\"-I/usr/local/opt/openssl/include\" --with-ldflags=\"-L/usr/local/opt/openssl/lib\"
@vmlinz
vmlinz / user.rb
Last active December 15, 2015 07:32
Rspec issue when testing user model
class User < ActiveRecord::Base
validates :auth_token, uniqueness: true
before_validation :downcase_email
before_create :generate_authentication_token!
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
def generate_authentication_token!
@vmlinz
vmlinz / add_secure_token.rb
Last active December 3, 2015 16:20
rails carrierwave qiniu images
class User < ActiveRecord::Base
attr_accessor :upload_secure_token
...
end