Skip to content

Instantly share code, notes, and snippets.

@yi
yi / fake-script.js
Created October 20, 2016 16:22 — forked from WebReflection/fake-script.js
hot to mock script requests
document.createElement = function (
createElement, // the native one
createResponse // the function "in charge"
) {
return function (nodeName) {
var result, src;
// if we are creating a script
if (/^script$/i.test(nodeName)) {
// result will be a place holder
result = createElement.call(
@yi
yi / open_app.html
Created February 22, 2017 08:46 — forked from noelrocha/open_app.html
Open app on Google Play or AppStore
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Open App</title>
<!--
URL Params:
customSchemeURL: Your custom scheme app
@yi
yi / LICENSE.txt
Created February 27, 2014 17:59 — forked from jed/LICENSE.txt
Fucking crazy UUID
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@yi
yi / gist:01e3ab762838d567e65d
Created July 24, 2014 18:52
lua hex <= => string
function string.fromhex(str)
return (str:gsub('..', function (cc)
return string.char(tonumber(cc, 16))
end))
end
function string.tohex(str)
return (str:gsub('.', function (c)
return string.format('%02X', string.byte(c))
end))