Skip to content

Instantly share code, notes, and snippets.

View raykin's full-sized avatar

raykin raykin

  • Shanghai,China
View GitHub Profile
@raykin
raykin / Useful Gems.markdown
Created February 9, 2012 09:44
Maybe useful gems of rails or ruby
@raykin
raykin / s3_directupload_helper.gemspec
Last active December 15, 2015 04:39
A ruby method to quickly generate s3 direct upload hash
Gem::Specification.new do |s|
s.name = 's3-directupload-helper'
s.version = '0.0.1'
s.platform = Gem::Platform::RUBY
s.author = 'Raykin'
s.email = 'raykincoldxiao@gmail.com'
s.summary = 'easy create s3 directupload form in rails'
s.description = 'clear and easy'
s.files = ['s3_directupload_helper.rb']
s.require_path = '.'
@raykin
raykin / _pg_tag_usage.md
Last active April 9, 2017 10:00
Extent PG array query in Rails

In Gemfile

gem 'pg_tag', git: 'git://gist.github.com/895e8e58ba83f72efd2a.git', require: 'pg_tag'

In rails model file

has_pg_tag **** # your col name
@raykin
raykin / 1 Gist conventions
Last active April 6, 2017 07:39 — forked from PavloBezpalov/1 Gist conventions
Deploy Rails 4.2.6 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL.
<<USER>> <<APP>> change this variables
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9