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
// Inspired from a package I think is called ts-attempt but can't find it anymore. | |
const failSymbol = Symbol('fail') | |
type Ok<T> = T | |
type Fail = { [failSymbol]: true; error: unknown } | |
type Result<T> = Ok<T> | Fail | |
export async function attempt<T>(fn: () => Promise<T>): Promise<Result<T>> { |
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
// Less | |
@navy: #001f3f; | |
@blue: #0074d9; | |
@aqua: #7fdbff; | |
@teal: #39cccc; | |
@olive: #3d9970; | |
@green: #2ecc40; | |
@lime: #01ff70; | |
@yellow: #ffdc00; | |
@orange: #ff851b; |
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
module.exports=xmlToJSON;var xmlToJSON=function(){this.version="1.3";var e={mergeCDATA:!0,grokAttr:!0,grokText:!0,normalize:!0,xmlns:!0,namespaceKey:"_ns",textKey:"_text",valueKey:"_value",attrKey:"_attr",cdataKey:"_cdata",attrsAsObject:!0,stripAttrPrefix:!0,stripElemPrefix:!0,childrenAsArray:!0},t=new RegExp(/(?!xmlns)^.*:/),r=new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){return this.parseXML(this.stringToXML(e),t)},this.parseXML=function(a,n){for(var s in n)e[s]=n[s];var l={},i=0,o="";if(e.xmlns&&a.namespaceURI&&(l[e.namespaceKey]=a.namespaceURI),a.attributes&&a.attributes.length>0){var u={};for(i;i<a.attributes.length;i++){var c=a.attributes.item(i);m={};var p="";p=e.stripAttrPrefix?c.name.replace(t,""):c.name,m[e.valueKey]=e.grokAttr?this.grokType(c.value.replace(r,"")):c.value.replace(r,""),e.xmlns&&c.namespaceURI&&(m[e.namespaceKey]=c.namespaceURI),e.att |
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 JSONP, Waveform, | |
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | |
window.Waveform = Waveform = (function() { | |
Waveform.name = 'Waveform'; | |
function Waveform(options) { | |
this.redraw = __bind(this.redraw, this); |
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
http://fediafedia.com/prank/win7/index.html |
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 current = 0; | |
var target = 0; | |
var updateDelay = 0; | |
var speed = 30 / 1000; | |
var lastTime = performance.now(); | |
function step() { | |
requestAnimationFrame(step); |
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
<link rel="import" href="../paper-button/paper-button.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
// Prefixes | |
(function() { | |
var w = window; | |
// performance.now | |
var p = w.performance = w.performance || {}; | |
p.now = | |
p.now || | |
p.webkitNow || | |
p.mozNow || |
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 sources = [ | |
'http://i2.kym-cdn.com/photos/images/newsfeed/000/697/069/753.png', | |
'http://i2.kym-cdn.com/entries/icons/original/000/001/030/dickbutt.jpg', | |
'http://i0.kym-cdn.com/photos/images/newsfeed/000/714/090/08e.jpg', | |
'http://i3.kym-cdn.com/photos/images/masonry/000/711/605/f6d.jpg' | |
]; | |
var index = parseInt(Math.random() * sources.length, 10); |
NewerOlder