Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tinyao on github.
  • I am tinyao (https://keybase.io/tinyao) on keybase.
  • I have a public key whose fingerprint is D975 11A9 4C8F 7010 311F B50D A86E 0E5B B704 2260

To claim this, I am signing this object:

define('@weex-component/item', function (require, exports, module) {
;
module.exports = {
data: function () {
return {
title: '',
description: '',
image: '',
url: ''
@tinyao
tinyao / github.css
Created November 13, 2015 11:37
github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@tinyao
tinyao / sur_tinyao.conf
Last active October 27, 2015 03:47
sur_tinyao.conf
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
// DNS OVERRIDE, REMOVE # IF YOU NEED
dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
[Proxy]
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=/usr/local/sublime-text-2/sublime_text
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
For future help about the same topic:
For Buttons, Checkboxs and ImageViews:
android:focusable="false"
Now both, buttons and rows of listview are clickable
For ImageButtons, you have to set focusable while running, because the constructor of ImageButtons sets it to true. I recomend you using a ImageView instead of a ImageButton.
@tinyao
tinyao / nav-current.rb
Last active December 24, 2015 06:59
Changing classes for current page nav link in rails
def link_to_with_current_class(name, options)
if current_page?(options)
content_tag :li, link_to(h(name), options, :class => name), :class => "current"
else
content_tag :li, link_to(h(name), options, :class => name)
end
end
<%= link_to_with_current_class 'Home', root_path %>
<%= link_to_with_current_class 'About', about_path %>
@tinyao
tinyao / source
Last active December 17, 2015 20:39
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
Namespace = ( ->
merge = (target, source) ->
for key, val of source
target[key] = val
target
_assertValidFQN = (fqn) ->
unless ///^[a-z0-9_.]+///.test fqn then throw 'invalid namespace'
class Procedure