Skip to content

Instantly share code, notes, and snippets.

@tyrotinal
tyrotinal / gist:7917930
Created December 11, 2013 20:32
jquery: window Resize
var resizeTimer;
$(window).resize(function() {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
var body_size = $('section').width();
// ...
// do your work here
// ...
}, 200);
});
@tyrotinal
tyrotinal / gist:7892671
Created December 10, 2013 15:41
Angular 1.2.4 CDN
https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.min.js
@tyrotinal
tyrotinal / gist:7892606
Created December 10, 2013 15:38
Bootstrap 3 CSS CDN
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
@tyrotinal
tyrotinal / gist:7892593
Created December 10, 2013 15:37
jQuery 2.0.3 CDN
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
@tyrotinal
tyrotinal / gist:7738672
Created December 1, 2013 18:12
less: fix-float
.fix-float(){
content:" ";display: block;visibility: hidden;height:0;clear:both;
}
.fix-float:after{
.fix-float();
}
@tyrotinal
tyrotinal / gist:7635475
Created November 25, 2013 02:45
jquery:animation syntex
$('p').animation(
{left: '10px',
bottom: '300px;',
opacity: '0'
},3000);
$('h1').animate({fontSize: '88px'}, 2000);
@tyrotinal
tyrotinal / ternary.js
Created October 5, 2013 21:20
js - ternary operator
var a = 2;
var b = 3;
var c = 4;
function sayHi(){
console.log("hello - a");
}
function sayHiB(){
console.log("hello - B");
@tyrotinal
tyrotinal / gist:6804666
Created October 3, 2013 03:49
html/css: fix floating issue for floated elements
#container:after{
content: " ";
display:block;
height:0;
clear:both;
visibility:hidden;
}
@tyrotinal
tyrotinal / sublime package manager
Created September 14, 2013 22:54
sublime package manager
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
@tyrotinal
tyrotinal / gist:6394477
Created August 30, 2013 21:32
bootstrap cdn 3
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">