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
// Change straight quotes to curly and double hyphens to em-dashes. | |
function smarten(a) { | |
a = a.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018"); // opening singles | |
a = a.replace(/'/g, "\u2019"); // closing singles & apostrophes | |
a = a.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c"); // opening doubles | |
a = a.replace(/"/g, "\u201d"); // closing doubles | |
a = a.replace(/--/g, "\u2014"); // em-dashes | |
return a | |
}; |
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 multiply(a, b) { | |
return a * b; | |
} | |
function divide(a, b) { | |
if (b === 0) { | |
throw "Don't try to divide by zero!"; | |
} | |
return Math.round(a / b); |
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
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/modifying-a-force-directed-graph |
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
lines with $ are commands | |
### install mkvtoolnix: | |
$ brew install mkvtoolnix | |
### list content of the mkv-file: | |
$ mkvmerge -i mymoviefile.mkv | |
### what will give you: |
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 encodeToGb2312(str){ | |
var strOut=""; | |
for(var i = 0; i < str.length; i++){ | |
var c = str.charAt(i); | |
var code = str.charCodeAt(i); | |
if(c==" ") strOut +="+"; | |
else if(code >= 19968 && code <= 40869){ | |
index = code - 19968; | |
strOut += "%" + z.substr(index*4,2) + "%" + z.substr(index*4+2,2); | |
} |
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($) { | |
// Used by dateinput | |
$.expr = {':': {}}; | |
// Used by bootstrap | |
$.support = {}; | |
// Used by dateinput | |
$.fn.clone = function(){ | |
var ret = $(); |
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
// background transparency | |
background-transparency(color, alpha = 1) | |
ms-color = argb(color, alpha) | |
background rgb(color) | |
background rgba(color, alpha) | |
.lt-ie8 & | |
zoom 1 | |
.lt-ie9 & | |
background transparent | |
filter s('progid:DXImageTransform.Microsoft.gradient(startColorstr=%s,endColorstr=%s)', ms-color, ms-color) |
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
:-moz-full-screen html, | |
:-moz-full-screen body, | |
html:-moz-full-screen, | |
body:-moz-full-screen { | |
overflow-y: auto | |
} |
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> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
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 a = "I'm a"; |
OlderNewer