Skip to content

Instantly share code, notes, and snippets.

Necole NecoleYu

  • Hangzhou China
View GitHub Profile
@Kazanz
Kazanz / OOP style directive controllers for Angular
Last active Aug 29, 2015
How to make base directive controllers that can be inherited in Angular.js
View OOP style directive controllers for Angular
app.directive('upgrade1', function () {
return {
restrict: 'E',
templateUrl: "my_template.html",
scope: {
'info': '=info',
},
controller: 'upgrade1',
}
});
@chengmu
chengmu / hybrid_app_notes.md
Last active Jan 27, 2016
Hybrid_APP_Notes
View hybrid_app_notes.md

以下为开发希望英语游戏的时候遇到的各种问题。

##IOS下click不正常冒泡

理论上click事件触发后会一直冒泡到document。但IOS上情况不一样。

在IOS上,click事件通常只会冒泡到body以下的节点;也就是说,不会触发body和document的click事件,把handler绑到这两者上面是没有用的。

只有在下列三种情况,click事件才会冒泡到body和document:

@welladamm
welladamm / .gitconfig
Last active Dec 16, 2015
My ~/.gitconfig setup
View .gitconfig
[user]
name = Adam Lau
email = skyros@gmail.com
[push]
default = current
[mergetool]
keepBackup = true
[merge]
tool = vimdiff
[core]
@dalethedeveloper
dalethedeveloper / gist:1503252
Created Dec 20, 2011
Mobile Device Detection via User Agent RegEx
View gist:1503252

#Mobile Device Detection via User Agent RegEx

Yes, it is nearly 2012 and this exercise has been done to death in every imaginable language. For my own purposes I needed to get the majority of non-desktop devices on to a trimmed down, mobile optimized version of a site. I decided to try and chase down an up-to-date RegEx of the simplest thing that could possibly work.

I arrived at my current solution after analyzing 12 months of traffic over 30+ US based entertainment properties (5.8M+ visitors) from Jan - Dec 2011.

The numbers solidified my thoughts on the irrelevancy of including browsers/OSes such as Nokia, Samsung, Maemo, Symbian, Ipaq, Avant, Zino, Bolt, Iris, etc. The brass tacks of the matter is that you certainly could support these obscure beasts, but are you really going to test your site on them? Heck, could you even find one?! Unless the folks that pay you are die hard Treo users my guess is "No".

Interestingly enough my research shows that /Mobile/ is more efficient than **/iP(

You can’t perform that action at this time.