Skip to content

Instantly share code, notes, and snippets.

View yhsiang's full-sized avatar
🙅‍♂️
それだめ

LY Cheng yhsiang

🙅‍♂️
それだめ
View GitHub Profile
@yhsiang
yhsiang / app.ls
Last active August 29, 2015 13:56
Simple toke-based angular auth module with Livescript
app = angular.module 'myApp' <[myAuth]>
# miss routing policy here, write it by urself
app.controller 'MenuCtrl' <[AuthService $scope]> ++ (AuthService, $scope) ->
$scope.login = ->
# redirect to Login Page
$scope.logout = -
$scope.login = ->
@yhsiang
yhsiang / gulpfile.ls
Last active August 29, 2015 13:56
multiple source for using gulpjs to build css files with Sass, Stylus, Pure CSS
require <[ gulp gulp-util gulp-concat gulp-stylus gulp-ruby-sass streamqueue]>
gulp.task 'styles' ->
stream = streamqueue object-mode: true
stream.queue gulp.src "#src-path/styles/**/*.sass" .pipe gulp-ruby-sass!
stream.queue gulp.src "#src-path/styles/**/*.styl" .pipe gulp-stylus!
stream.queue gulp.src "#src-path/styles/**/*.css"
stream.done!
.pipe gulp-concat 'all.css'
.pipe gulp.dest "#{dest-path}/styles"
@yhsiang
yhsiang / app.js
Last active August 29, 2015 13:57
angular
.module('lance',[])
.controller('listCtrl', ['$scope', function($scope){
$scope.legislators =[{
name: '丁守中',
avatars: '....',
emblem: 'img/kmt.svg',
choice: 'choice-unknown'
},
{
@yhsiang
yhsiang / gist:11114544
Created April 20, 2014 13:47
zhutil usage
# html
<div class="well well-small">
<p class="text-error">因監察院只提供圖檔,此為初步轉檔結果,尚未完整校正,歡迎<a href="https://docs.google.com/spreadsheets/d/16UxAPkZLtU8OVJQCJasqnqOkHfceArbM05zo0FYRcbw/edit#gid=0" target="_blank">回報錯誤</a>,將盡快修正。找原始檔 -&gt; <a href="http://sunshine.cy.gov.tw/GipOpenWeb/wSite/sp?xdUrl=/wSite/SpecialPublication/baseQuery.jsp" target="_blank">監察院財產申報資料</a></p>
2013-12-12的股票總額: 24筆,共<span class="number">253796240 </span>元<br>
2012-04-19的股票總額: 21筆,共<span class="number">227748080 </span>元<br>
@yhsiang
yhsiang / gist:11319907
Last active August 29, 2015 14:00
鄉民OCR timeline
@yhsiang
yhsiang / AreaCode
Last active August 29, 2015 14:01
衛福部-鄉鎮代號對照表
CRA_31 新北市
CRA_01 臺北市
CRA_11 基隆市
CRA_32 桃園縣
CRA_33 新竹縣
CRA_12 新竹市
CRA_35 苗栗縣
CRA_36 臺中縣
CRA_17 臺中市
CRA_38 南投縣
@yhsiang
yhsiang / main.ls
Last active August 29, 2015 14:01
require! <[request cheerio fs async prelude-ls]>
_ = prelude-ls
jar = request.jar!
request = request.defaults jar: jar
base-form =
'__EVENTTARGET':''
'__EVENTARGUMENT':''
@yhsiang
yhsiang / gist:de8a1daf99d634bfc2db
Last active August 29, 2015 14:01
拿回自己的力量

拿回自己的力量

更讓人期待的,則是多元又精彩的獨立媒體現象。許多知識工作者再也無法忍受財團與政治勢力對於媒體獨立性的侵蝕, 選擇以網路打開新通路。例如,金融界的傑出人物張果軍先生與傳統媒體指標人物王健壯先生,聯手成立了以維護媒體獨 立性的「風傳媒」。民主的庸俗墮落,其實是許多民主國家共同的弊病,於是德國出現了以網路工具直接監督議會的「國 會觀察」網站,並且大獲成功,而且逐漸擴散到歐洲各國。台灣則出現「零時政府」,九百多位無酬參與者,出於不滿民 主現狀,以科技實踐公民參與。他們串連討論開發出「立院影城」、「立法院專案」等二十個網路應用工具。不管是中央 政府預算、民意代表的政商互動,或是任何政治運作,都已經從黑盒子解放出來,一切無所遁形。在科技的發展下,只要 能上網,選民就能監督自己選出的民代。

@yhsiang
yhsiang / gist:d1dc7275779df5fa95f7
Created May 22, 2014 07:31
Bas16 tomorrow-dark colors
// These colors are specific to the theme. Do not use in a package!
@very-light-gray: #c5c8c6;
@light-gray: #969896;
@gray: #373b41;
@dark-gray: #282a2e;
@very-dark-gray: #1d1f21;
@cyan: #8abeb7;
@blue: #81a2be;
@purple: #b294bb;
@yhsiang
yhsiang / gulp-task.ls
Created May 26, 2014 07:09
emit end on error
gulp.task \style ->
gulp.src paths.styles
.pipe plumber!
.pipe stylus { +errors, use: [nib!]}
.on 'error' -> @emit 'end'
.pipe gulp.dest "css"
.pipe lr!