Skip to content

Instantly share code, notes, and snippets.

View xxjinwei's full-sized avatar
💻
Working...

Celile Fulwood xxjinwei

💻
Working...
View GitHub Profile
@xxjinwei
xxjinwei / gist:6ae5af7e8c7a7b1b95ad
Last active August 29, 2015 14:27 — forked from lucifr/gist:1208100
Sublime Text 2 - 实用快捷键 (Mac OS X)
input:-webkit-autofill {
-webkit-box-shadow:0 0 0 50px white inset; /* background color */
-webkit-text-fill-color: #333; /* color */
}
@xxjinwei
xxjinwei / promise.js
Last active August 29, 2015 14:27
promise
// http://dailyjs.com/2014/02/20/promises-in-detail/
function Promise(fn) {
var state = 'pending';
var value;
var deferred = null;
function resolve(newValue) {
if(newValue && typeof newValue.then === 'function') {
newValue.then(resolve, reject);
@xxjinwei
xxjinwei / notr.js
Created June 30, 2015 08:46
chrome no google translate bar
<meta name="google" value="notranslate">
@xxjinwei
xxjinwei / border-opacity
Last active August 29, 2015 14:14
border opacity
border-color: rgba(0, 0, 0, .3);
background-clip: padding-box;
@xxjinwei
xxjinwei / gist:95e8c6c8bab71e2a0ed8
Created December 11, 2014 10:24
vertical align middle using margin auto
//works ok ie8+
.middle {
width: 600px; height: 400px;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
}
@xxjinwei
xxjinwei / v27
Created November 20, 2014 06:53
v27
<script>
if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) > 820) {
document.documentElement.className += "v27"
}
</script>
@xxjinwei
xxjinwei / 0_reuse_code.js
Last active August 29, 2015 14:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xxjinwei
xxjinwei / flex.css
Last active August 29, 2015 14:08
cross browser flex
.flex-container {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
width: 100%;
}
@xxjinwei
xxjinwei / README.md
Last active August 29, 2015 14:07 — forked from addyosmani/README.md

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version