Skip to content

Instantly share code, notes, and snippets.

View angusjune's full-sized avatar
🤪
hyped up

Angus Zhu angusjune

🤪
hyped up
View GitHub Profile
@angusjune
angusjune / reset.css
Created October 8, 2019 08:36
A modern CSS reset.
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default padding */
ul[class],
ol[class] {
Frankly, my dear, I don't give a damn.
@angusjune
angusjune / preload.js
Created September 28, 2014 09:35
Image Preload
var preload = ['1.png', '2.png', '3.png'];
var images = [];
for (var i = 0; i < preload.length; i++) {
images[i] = new Image();
images[i].src = prelaod[i];
}
@angusjune
angusjune / font.css
Created June 18, 2014 12:50
Better Helvetica Font Family
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
}
@angusjune
angusjune / background.js
Last active August 29, 2015 14:02
Chrome Extension Gist
// Click to inject js into page
chrome.browserAction.onClicked.addListener(function(tab) {
chrometabs.executeScript(null, {file:'js/injector.js'});
});
@angusjune
angusjune / filters.css
Last active August 29, 2015 13:58
CSS Filters
/*灰度*/
.grayscale {
-webkit-filter: grayscale(1);
filter: grayscale(1);
}
/*褐色*/
.sepia {
-webkit-filter: sepia(1);
filter: sepia(1);
@angusjune
angusjune / interval.js
Created December 11, 2013 08:03
Javascript functions
//a alternative to javascript setInterval
function interval(func, wait, times){
var interv = function(w, t){
return function(){
if(typeof t === "undefined" || t-- > 0){
setTimeout(interv, w);
try{
func.call(null);
}
catch(e){
/* one item */
li:first-child:nth-last-child(1) {
width: 100%;
}
/* two items */
li:first-child:nth-last-child(2),
li:first-child:nth-last-child(2) ~ li {
width: 50%;
}
@angusjune
angusjune / color.md
Last active December 30, 2015 05:49
Sass Snippets
p {         
  color: rgba(255, 0, 0, 0.75) + rgba(0, 255, 0, 0.75);        
}

is compiled to:

p { 
@angusjune
angusjune / disable-double-tap-resize.html
Last active December 30, 2015 05:29
iOS web app snippets
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">