A better btoa
and atob
that supports non-ASCII characters in a healthy manner.
Compatible with AMD, CommonJS, and ES2015 module loaders.
<?php | |
/******************************************************************************* | |
* Expandable Class | |
* | |
* Authors:: anthony.gallagher@wellspringworldwide.com | |
* | |
* Copyright:: Copyright 2009, Wellspring Worldwide, LLC Inc. All Rights Reserved. | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at |
(f={f () { return 'f' }, g () { return 'g' }}['f'],f&&f()||new Error) |
var expose=(strings,...expressions)=>{return{strings,expressions}}; | |
JSON.stringify((expose`var ${expose(`expose=${expose}`)};`),undefined,2); |
function detectPrivateMode(a){var b;if(window.webkitRequestFileSystem)window.webkitRequestFileSystem(window.TEMPORARY,1,function(){b=!1},function(a){b=!0});else if(window.indexedDB&&/Firefox/.test(window.navigator.userAgent)){var c;try{c=window.indexedDB.open("test")}catch(a){b=!0}void 0===b&&t(function(){return"done"===c.readyState},function(a){a||(b=!c.result)})}else if(o(window.navigator.userAgent)){b=!1;try{window.indexedDB||(b=!0)}catch(a){b=!0}}else if(window.localStorage&&/Safari/.test(window.navigator.userAgent)){if(window.safariIncognito)b=!0;else try{window.localStorage.setItem("test",1)}catch(a){b=!0}void 0===b&&(b=!1,window.localStorage.removeItem("test"))}t(function(){return void 0!==b},function(c){a(b)})} |
<html> | |
<head> | |
<style> | |
body *:before { | |
content: attr(value) ' ' | |
} | |
</style> | |
</head> | |
<body> | |
<div value=works /> |
Make any page look like-ish Markdown.
http://mrcoles.com/demo/markdown-css/?ref=webdesignernews.com
markdownishify.min.js
to your clipboardfunction launchWorker(f) { | |
if (! (f instanceof Function)) { | |
throw new Error(`Cannot launch ${typeof(f)} as Worker`); | |
} | |
const src = `(${f})();`; | |
const blob = new Blob([src], {type: 'application/javascript'}); | |
const url = URL.createObjectURL(blob); | |
return new Worker(url); | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Building a router</title> | |
<script> | |
// Put John's template engine code here... | |
(function () { | |
// A hash to store our routes: |
#!/bin/sh | |
## | |
# This is a script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# Run in interactive mode with: | |
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
# | |
# or run it without prompt questions: |