Skip to content

Instantly share code, notes, and snippets.

View dingyi's full-sized avatar
🏠
Working from home

Ding Yi dingyi

🏠
Working from home
View GitHub Profile
@dingyi
dingyi / Weibo V5
Created September 4, 2012 03:50
Weibo v5
#pl_content_publisherTop,
#pl_leftnav_app,
.WB_right_tips,
.W_rightModule,
.WB_right_module,
.tips_wrapper,
.W_main_r {
display: none;
}
.W_main_l {
@dingyi
dingyi / gist:3486819
Created August 27, 2012 09:08 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dingyi
dingyi / high-dpi-media.css
Created August 24, 2012 11:51 — forked from marcedwards/high-dpi-media.css
A CSS media query that captures almost all high DPI aware devices.
/* -------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs with IE zoomed in */
/* - Android hdpi devices and above */
/* - Android tvdpi devices, including Google Nexus 7 */
@dingyi
dingyi / pr.md
Created August 15, 2012 04:14 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@dingyi
dingyi / dabblet.css
Created June 13, 2012 02:28 — forked from kejun/dabblet.css
Untitled
.item {
margin-bottom: 20px;
padding: 10px;
font-size: 0;
border: 1px solid #efefef;
}
.item .pic ,
.item .content {
display: table-cell;
*display: inline;
@dingyi
dingyi / dabblet.css
Created April 22, 2012 14:08 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@dingyi
dingyi / hack.sh
Created April 1, 2012 04:52 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@dingyi
dingyi / PSPDFWebViewController.m
Created March 7, 2012 17:48
How to write a pixel perfect backbutton in code. (stuff goes into viewDidLoad). Taken from http://pspdfkit.com
forwardBarButtonItem_ = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(goForward:)];
// back button needs more treatment...
UIGraphicsBeginImageContextWithOptions(CGSizeMake(27, 22), NO, 0.0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColor(context, CGColorGetComponents([UIColor blackColor].CGColor));
CGContextBeginPath(context);
CGContextMoveToPoint(context, 8.0f, 13.0f);
CGContextAddLineToPoint(context, 24.0f, 4.0f);
CGContextAddLineToPoint(context, 24.0f, 22.0f);
@dingyi
dingyi / _grid-base.sass
Created February 24, 2012 00:37
Fluid Desktop & Mobile Grid
// This file requires Sass & Compass.
//
// - http://sass-lang.com
// - http://compass-style.org
@import compass/css3/box-sizing
// `Clear floated elements.
//----------------------------------------------------------------------------------------------------
@dingyi
dingyi / data-markdown.user.js
Created January 22, 2012 17:25 — forked from paulirish/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.