This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html,<title>Hello Data URL</title><p>File-less HTML page!</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var t = setInterval(function(){ | |
// Do stuff | |
},1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document) | |
.scrollTop( (localStorage.scrollPos) ? localStorage.scrollPos : 0 ) | |
.on('scroll', function() { | |
localStorage.scrollPos = $(document).scrollTop(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************** | |
* Website | |
****************************************************/ | |
// Page title | |
document.title.substring(0, 200); | |
// Domain (i.e. gist.github.com) | |
document.domain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Downloading a file | |
header("Content-type: application/csv"); | |
header("Content-Disposition: attachment; filename=".date('Ymd-His ').$this->query.".csv"); | |
header("Pragma: no-cache"); | |
header("Expires: 0"); | |
// Check if file exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function c($msg, $echo = 0) { | |
if (!isset($_SESSION['console'])) { $_SESSION['console'] = "";} | |
if ($echo) { | |
$buffer = "<pre>".$_SESSION['console']."</pre>"; | |
$_SESSION['console']=""; | |
return $buffer; | |
}else{ | |
$_SESSION['console'] = $_SESSION['console']." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With for..in | |
var stuff, key; | |
stuff = []; | |
stuff[0] = "zero"; | |
stuff[9999] = "nine thousand nine hundred and ninety-nine"; | |
stuff.name = "foo"; | |
for (key in stuff){ | |
if (stuff.hasOwnProperty(key) && String(Number(key)) === key) { | |
console.log("stuff[" + key + "] = " + stuff[key]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-webkit-keyframes imageBeat, | |
@-moz-keyframes imageBeat, | |
@-ms-keyframes imageBeat, | |
@-o-keyframes imageBeat, | |
@keyframes imageBeat { | |
0% { transform: scale(1); } | |
2% { transform: scale(1.02); } | |
5% { transform: scale(1); } | |
100% { transform: scale(1); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Twitter Bootstrap LESS mixin */ | |
.transition(@property: all, @duration: 0.2s, @animation: ease-in) { | |
transition:@property @duration @animation; | |
} | |
// Used like | |
.transition(); | |
.transition(all, .2s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The formula for calculating the Top Rated 250 Titles gives a true Bayesian estimate: | |
weighted rating (WR) = (v ÷ (v+m)) × R + (m ÷ (v+m)) × C | |
where: | |
R = average for the movie (mean) = (Rating) | |
v = number of votes for the movie = (votes) | |
m = minimum votes required to be listed in the Top 250 (currently 25000) | |
C = the mean vote across the whole report (currently 7.0) |