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
.reblogr { | |
position: absolute; | |
right: 5px; | |
top: 5px; | |
} | |
.reblogr a { | |
background-color: rgba(0, 0, 0, 0.5); | |
float: left; | |
margin-left: 3px; |
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
(function (win) { | |
'use strict'; | |
var doc = win.document, | |
scrollTop, | |
pagination = doc.getElementsByClassName('pagination')[0], | |
loadingPosts = false, | |
xhr = new win.XMLHttpRequest(), | |
page = 1, | |
nextHref = win.location.href + (win.location.pathname === '/' ? '' : '/') + 'page/'; |
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 enter = (mobile ? 'touchstart' : 'mouseenter'), | |
leave = (mobile ? 'touchend' : 'mouseleave'), | |
events = {}; | |
events[enter] = function () { ... } | |
events[leave] = function () { ... } | |
$('selector').on(events); |
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 elements = [el1, el2, elN]; | |
while (elements.length) { | |
elements.shift(); // This is the element | |
} |
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 | |
// Requires "file", "size" and "default" parameters | |
if (!isset($_REQUEST["file"]) || !isset($_REQUEST["size"]) || !isset($_REQUEST["default"])) { | |
die("Expected to find \"file\", \"size\" and \"default\" parameters."); | |
} | |
// URL of file | |
$url = $_REQUEST["file"]; |
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 lastTime = 0, | |
currTime, | |
timeToCall, | |
id; | |
window.requestAnimationFrame = window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
window.oRequestAnimationFrame || |
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
function friendlyDate($s) { | |
$minutes = (time() - strtotime($s)) / 60; | |
if ($minutes < 1) return "Seconds ago"; | |
if ($minutes < 2) return "1 minute ago"; | |
if ($minutes < 60) return floor($minutes)." minutes ago"; | |
$hours = $minutes / 60; | |
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
const int BUTTON_PIN = 2; | |
void setup() { | |
pinMode(BUTTON_PIN, INPUT); | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
void loop() { | |
int buttonState = digitalRead(BUTTON_PIN); | |
digitalWrite(LED_BUILTIN, buttonState); |
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 setup function runs once when you press reset or power the board | |
void setup() { | |
// Initialize digital pin LED_BUILTIN as an output. | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
// The loop function runs over and over again forever | |
void loop() { | |
// Turn the LED on (HIGH is the voltage level) | |
digitalWrite(LED_BUILTIN, HIGH); |
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
const int BUTTON_PIN = 2; | |
// The setup function runs once when you press reset or power the board | |
void setup() { | |
// Initialize button pin as a pull-up input. | |
pinMode(BUTTON_PIN, INPUT_PULLUP); | |
// Initialize digital pin LED_BUILTIN as an output. | |
pinMode(LED_BUILTIN, OUTPUT); | |
} |