This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.
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
// A few terminal commands to determine SSD, display manufacturer | |
// Display Manufacturer | |
ioreg -lw0 | grep \"EDID\" | sed "/[^<]*</s///" | xxd -p -r | strings -6 | |
LPXXXX = LG | |
LSNXXXX = Samsung | |
// SSD Manufacturer |
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
require('http').request({ | |
host: 'example.com', | |
path: '/path/to/get', | |
method: 'GET' | |
}, function(res) { | |
res.setEncoding('utf8'); | |
var body = ''; | |
res.on('data', function(chunk) { | |
body += chunk; | |
}); |
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 | |
// Generating stronger PHP session IDs | |
// Change from default PHPSESSID | |
ini_set('session.name','my_cookie'); | |
// Use only cookies to prevent session ID hijacking | |
ini_set('session.use_cookies', 'true'); | |
ini_set('session.use_only_cookies', 'true'); |
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() { | |
var links = document.querySelectorAll('.ogAggregationSubstorySlideHeadline > a'); | |
for( var i=0, len=links.length; i < len; i += 1) { | |
var url = links[i].getAttribute('href'); | |
url = decodeURIComponent(url.split("?")[1].split("&")[2].split("=")[1]); | |
links[i].setAttribute('href',url); | |
links[i].setAttribute('target','_blank'); | |
} | |
}()); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Fit canvas to viewport for mobile devices</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
} |
NewerOlder