Skip to content

Instantly share code, notes, and snippets.

View chenillen's full-sized avatar
🤩

Allen C. chenillen

🤩
View GitHub Profile
<!-- parent -->
<template>
<div class="page-container">
<custom-text @custom-click="customClick" />
</div>
</template>
<script>
import wepy from '@wepy/core'
<script>
import wepy from 'wepy'
export default class Child1 extends wepy.page {
props = {
childId: {
type: String,
default: null
}
}
@chenillen
chenillen / prestyle.css
Created August 21, 2012 09:09
Nice Display of Web...
html,body{
-webkit-font-smoothing:antialiased!important;
font-family:Avenir,'Helvetica Neue'!important;
}
@chenillen
chenillen / cursor-finder.js
Created December 29, 2011 03:58
Find input Cursor
function getCursorPos() {
var cursorPos;
if (window.getSelection) {
var selObj = window.getSelection();
var selRange = selObj.getRangeAt(0);
cursorPos = findNode(selObj.anchorNode.parentNode.childNodes, selObj.anchorNode) + selObj.anchorOffset;
/* FIXME the following works wrong in Opera when the document is longer than 32767 chars */
alert(cursorPos);
}
else if (document.selection) {
@chenillen
chenillen / klasses.rb
Created November 9, 2011 09:11
polymorphic counter cache problem
class Allen < ActiveRecord::Base
has_many :joins, :as => :resource
...
end
class Bob < ActiveRecord::Base
has_many :joins, :as => :resource
...
end
@chenillen
chenillen / hosts
Created February 10, 2011 08:25
My Hosts
# Twitter
65.49.26.99 twitter.com
65.49.26.98 si0.twimg.com
65.49.26.98 si1.twimg.com
65.49.26.98 si2.twimg.com
65.49.26.98 si3.twimg.com
65.49.26.98 si4.twimg.com
65.49.26.98 si5.twimg.com
65.49.26.97 api.twitter.com
艺术|Art
喜剧|Comedy
漫画|Comics
舞蹈|Dance
设计|Design
时尚|Fashion
电影与视频|Film-and-Video
食品|Food
游戏|Games
新闻|Journalism
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 example.com
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
## Want a route like http://example.com/:id/photos in Rails 3
# I have a username route below
class User < ActiveRecord::Base
def to_param
screen_name
end
end
match ':id' => 'users#show', :as => 'user_profile'
台北|Taipei|TW
高雄|Kaohsiung|TW
台中|Taichung|TW
台南|Tainan|TW
板橋|Banqiao|TW
中和|Zhonghe|TW
新竹|Hsinchu|TW
新莊|Xinzhuang|TW
桃園|Taoyuan|TW
基隆|Keelung|TW