Skip to content

Instantly share code, notes, and snippets.

View rayshih's full-sized avatar

Ray Shih rayshih

View GitHub Profile
puts 'hello world'
@rayshih
rayshih / vimrc_2014
Created January 12, 2015 05:54
My vimrc
" Vundle setting start
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
@rayshih
rayshih / proactive_vs_reactive.js
Created January 31, 2015 08:54
Proactive vs Reactive
// proactive
var obj = {
a: 0,
b: 1
};
obj.a = 3;
obj.b = a + 1; // proactive
console.log(obj.b); // b = 4
button.setOnClickListener(new View.OnClickListener {
@Override
public void click(Event event) {
// do something here
}
});
button.onClick(event => {
// do something here
})
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'jp.leafytree.gradle:gradle-android-scala-plugin:1.4'
}
}
// 在最上面加入 apply plugin
apply plugin: "com.android.application"
apply plugin:"jp.leafytree.android-scala"
compile 'org.scala-lang:scala-library:2.11.7'
package com.example.rayshih.scala_example
import android.app.Activity
import android.os.Bundle
import android.widget.TextView
class MainActivity extends Activity {
override def onCreate(savedInstanceState: Bundle): Unit = {
super.onCreate(savedInstanceState)
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}