Skip to content

Instantly share code, notes, and snippets.

View 0oneo's full-sized avatar
😃
Go Li

0oneo 0oneo

😃
Go Li
  • 阿里本地生活
  • Shanghai
View GitHub Profile
@0oneo
0oneo / add_hair_line.m
Last active December 25, 2015 12:13
add hairline to a view
//| ----------------------------------------------------------------------------
// Called when the view is about to be displayed. May be called more than
// once.
//
- (void)willMoveToWindow:(UIWindow *)newWindow {
// Use the layer shadow to draw a one pixel hairline under this view.
[self.layer setShadowOffset:CGSizeMake(0, 1.0f/UIScreen.mainScreen.scale)];
[self.layer setShadowRadius:0];
// UINavigationBar's hairline is adaptive, its properties change with
@0oneo
0oneo / common_regular_expression.rb
Created February 3, 2016 07:09
some common used regular expression collected from the web
[\x{4e00}-\x{9fa5}] // used for match Chinese character | 用来匹配中文
@0oneo
0oneo / bootstrap_pre_extra_blank.js
Created May 2, 2017 03:44
remove bootstrap extra blank caused by document outline
<script>
/*!
*** prettyPre ***/
(function( $ ) {
$.fn.prettyPre = function( method ) {
var defaults = {
ignoreExpression: /\s/ // what should be ignored?
@0oneo
0oneo / gist:72c7120ffd411a8a314b3db37b37216a
Created June 18, 2017 03:19
get all magnet links from a web page
$("a[href*='magnet']").map(function() {return this.href}).get().join("\n")