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
/* Hexagon kitty - By @LeaVerou | |
Disappointingly inflexible, but still interesting methinks. | |
*/ | |
.hexagon { | |
display: inline-block; | |
position: relative; | |
width: 200px; | |
height: 200px; | |
transform: scale(1.25,.707) rotate(-45deg); |
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 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
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
<?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
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
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); | |
} |
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
#include "MIDIUSB.h" | |
const byte TOTAL_BUTTONS = 16; | |
// All the Arduino pins used for buttons, in order. | |
const byte BUTTONS_PIN[TOTAL_BUTTONS] = {2,3,4,5,6,7,8,9,10,11,12,A0,A1,A2,A3,A4}; | |
// Every pitch corresponding to every Arduino pin. Each note has an associated numeric pitch (frequency scale). | |
// See https://github.com/arduino/tutorials/blob/master/ArduinoZeroMidi/PitchToNote.h | |
const byte BUTTONS_PITCH[TOTAL_BUTTONS] = {36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; | |
// Current state of the pressed buttons. | |
byte currentRead[TOTAL_BUTTONS]; |