Skip to content

Instantly share code, notes, and snippets.

@nealnote
nealnote / css3-transition
Last active August 29, 2015 14:01
css transition
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title>transition</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/base-min.css">
<style type="text/css">
.sc {
margin-top: .6em;
text-align: center;
@nealnote
nealnote / css3-first-screen
Created May 30, 2014 03:16
css3-first-screen
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title>first-screen</title>
<style type="text/css">
body {
padding: 0;
margin: 0;
}
@nealnote
nealnote / css3-transition-box-shadow.html
Created June 4, 2014 06:08
css3-transition-box-shadow.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title>css3-transition-box-shadow</title>
<link rel="stylesheet" href="http://necolas.github.io/normalize.css/3.0.1/normalize.css">
<style type="text/css">
.list {
margin-top: 60px;
border-left: 1px solid #E8E8E8;
@nealnote
nealnote / google-ip-list
Created June 12, 2014 01:38
google ip list
var list = new Array("Bulgaria", "93.123.23.1/59",
"Egypt", "197.199.253.1/59",
"Egypt", "197.199.254.1/59",
"Hong Kong", "218.189.25.129/187",
"Hong Kong", "218.253.0.76/92", "218.253.0.140/187",
"Iceland", "149.126.86.1/59",
"Indonesia", "111.92.162.4/6", "111.92.162.12/59",
"Iraq", "62.201.216.196/251",
"Japan", "106.162.192.132/187",
"Japan", "106.162.198.68/123",
@nealnote
nealnote / osx_setting.sh
Created June 24, 2014 05:53
osx setting
# Enable full keyboard access for all controls
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Disable menu bar transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Allow quitting Finder via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true
# Avoid creating .DS_Store files on network volumes
@nealnote
nealnote / css-reset-box-sizing
Created July 21, 2014 06:49
css-reset-box-sizing
/**
* http://blog.teamtreehouse.com/box-sizing-secret-simple-css-layouts#comment-50223
*/
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
var quickSort = function(arr){
if ( arr.length <= 1 ) {
return arr;
}
var sampleIndex = Math.floor(arr.length/2),
sample = arr.splice(sampleIndex, 1)[0],
left = [],
right = [];
for (var i = 0; i < arr.length ; i++){
if ( arr[i] < sample ) {
@nealnote
nealnote / requestAnimationFrame.js
Created July 29, 2014 01:06
requestAnimationFrame.js
//https://github.com/gabrielecirulli/2048/blob/master/js/animframe_polyfill.js
(function () {
var lastTime = 0;
var vendors = ['webkit', 'moz'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
window[vendors[x] + 'CancelRequestAnimationFrame'];
}
@nealnote
nealnote / requestAnimationFrame.html
Created August 1, 2014 03:36
requestAnimationFrame.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title> requestAnimationFrame </title>
<style type="text/css">
.mover {
position: absolute;
height: 100px;
width: 100px;
@nealnote
nealnote / guid.js
Created August 5, 2014 06:36
guid.js
//https://github.com/jeromegn/Backbone.localStorage/blob/master/backbone.localStorage.js#L27
// Generate four random hex digits.
function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
};
// Generate a pseudo-GUID by concatenating random hexadecimal.
function guid() {
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
};