Skip to content

Instantly share code, notes, and snippets.

View mjason's full-sized avatar

Mj mjason

  • South China University of Technology
  • Guangzhou, China
  • 11:23 (UTC +08:00)
View GitHub Profile
@mjason
mjason / deploy.rb
Created May 29, 2013 03:28
mina部署脚本
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (http://rvm.io)
set :domain, 'xxx.xxx.xxx'
set :deploy_to, '/home/xxxx/xxxx'
set :repository, 'git@xxxx'
set :branch, 'master'
set :shared_paths, ['config/database.yml', 'log']
# coding: utf-8
gsub_file "Gemfile", /https:/, "http:"
gem 'devise'
gem "cancan", "~> 1.6.10"
gem "mongoid", git: "https://github.com/mongoid/mongoid.git", ref: "85e146637503522939b3a6b942c84d1bbc55c00a"
gem 'carrierwave', '0.6.2'
gem 'mini_magick','3.3', require: false
@mjason
mjason / build.gradle
Created November 27, 2013 10:56
androidannotations 配置例子
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
@mjason
mjason / database.js
Created November 28, 2013 15:40
sequelize for express 配置
var config = require('./config.json')
var environment = process.env.NODE_ENV || 'development'
var databaseConfig = config[environment]
var Sequelize = require('sequelize')
var sequelize = new Sequelize(databaseConfig.database,
databaseConfig.username, databaseConfig.password, {
host: databaseConfig.host,
dialect: databaseConfig.dialect,
@mjason
mjason / build.gradle
Created November 30, 2013 09:07
androidannotations的android studo 配置
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@mjason
mjason / NGDK
Created January 10, 2014 08:04
package cn.glassx.ngk.app;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
import com.google.android.glass.widget.CardScrollView;
import java.util.ArrayList;
@mjason
mjason / Vagrantfile
Last active August 29, 2015 14:15 — forked from ianmstew/Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require "rbconfig"
HOST_NAME = "prerender"
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
@mjason
mjason / caoliu.json
Last active September 1, 2015 08:06
{
"url": "http://t66y.com/index.php",
"cookie": "ismob=1",
"color": "#F9F9EC",
"title": "草榴",
"js": "https://gist.githubusercontent.com/mjason/75ff71e05a5b1fea1a2e/raw/07a2fde707995705ca8b2c4db79742234728d64c/index.js"
}
@mjason
mjason / init.el
Created September 25, 2015 05:48
react native emacs setting
;; please install web-mode
;; in your .emacs.d/init.el
(add-to-list 'auto-mode-alist '(".*/react/.*\\.js[x]?\\'" . web-mode))
(setq web-mode-content-types-alist
'(("jsx" . "/.*/react/.*\\.js[x]?\\'")))