Skip to content

Instantly share code, notes, and snippets.

View rayshih's full-sized avatar

Ray Shih rayshih

View GitHub Profile
<html>
<head>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<style>
#outer {
width: 500px;
height: 500px;
display: -webkit-box;
-webkit-box-orient: horizontal;
@rayshih
rayshih / TotalH
Created August 8, 2012 11:57
Sun the total time like [12h] in trello
javascript:(function(){total = 0;$($(".list-area").html().match(/\[([^\]]+)h\]/g)).each(function(i, s){total += parseInt(s.match(/\d+/))});alert(total + "\n" + total/8);})();
@rayshih
rayshih / insert_jquery.js
Created October 31, 2012 08:28
Insert jQuery To Any Page
javascript:(function(){script = document.createElement("script");script.src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js";document.body.appendChild(script);})();
@rayshih
rayshih / rs_vim_setting.vimrc
Created November 30, 2012 14:02
Ray Shih's Vim setting
" Vundle setting start
set nocompatible " be iMproved
filetype off " required!
" Powerline setting
set laststatus=2 " Always show the statusline
set encoding=utf-8 " Necessary to show Unicode glyphs
let g:Powerline_symbols = 'fancy'
set rtp+=~/.vim/bundle/vundle/
// In Manifest:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity> ... </activity>
<receiver android:name=".AlarmReceiver"></receiver>
</application>
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
})