Skip to content

Instantly share code, notes, and snippets.

View mjason's full-sized avatar

Mj mjason

  • South China University of Technology
  • Guangzhou, China
  • 09:45 (UTC +08:00)
View GitHub Profile
@mjason
mjason / Dockerfile
Last active February 25, 2024 21:51
build phoenix in docker
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y git wget curl build-essential
RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && dpkg -i erlang-solutions_1.0_all.deb
RUN apt-get update
RUN apt-get install erlang -y
RUN apt-get install -y elixir
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
defmodule Absinthe.Ecto do
import Absinthe.Resolution.Helpers
@moduledoc """
Provides some helper functions for easy batching of ecto assocations
These functions all make use of the batch plugin found in Absinthe, they're
merely just some helpful ways to use this plugin in the context of simple ecto
associations.
@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]?\\'")))
@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 / 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 / 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;

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 / 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'
@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 27, 2013 10:56
androidannotations 配置例子
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'