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 beep() { | |
let snd = new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRw |
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
const throttle = (callback, limit) => { | |
let wait = false | |
return function() { | |
if (!wait) { | |
callback.call(this) | |
wait = true | |
setTimeout(() => wait = false, limit) | |
} | |
} | |
} |
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
mixin wraper() | |
- var prevBuf = pug_html | |
- pug_html = '' | |
- block() | |
- wrapResult = pug_html | |
- pug_html = prevBuf | |
mixin wrap() | |
- var prevBuf = pug_html | |
- pug_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
<template lang="jade"> | |
#app | |
h1 {{title | uppercase}} | |
ul(v-if="todos.length") | |
li.task( | |
v-for="task in tasks", | |
:class="{ done: task.done }", | |
@click="task.done = !task.done" | |
) {{task.content}} | |
p(v-else) Task List is empty. |
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
1//1;''' PYTHON | |
/*1//1''' | |
c=input() | |
n=int(c) | |
while n:print(c*n);n=n-1 | |
1//1;''' | |
*/1//1''' |
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 { | |
width: 900px; | |
position: relative; | |
} | |
.a:before { | |
content: ''; | |
display: block; | |
width: 100%; | |
padding-bottom: 56.25%; | |
position: relative; |
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
wait = (condition, successCallback, time, timeoutCallback, frequency=250, loadingCallback) -> | |
time *= 1000 / frequency if time? | |
waiting = setInterval -> | |
if condition.call() | |
successCallback.call() | |
else if time? && --time <= 0 | |
timeoutCallback?.call() | |
else | |
loadingCallback?.call() | |
return |
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
window.downloadFile = function(url,name) { | |
if (window.downloadFile.isChrome || window.downloadFile.isSafari) { | |
var link = document.createElement('a'); | |
link.href = url; | |
if (link.download !== undefined){ | |
var fileName = url.substring(url.lastIndexOf('/') + 1, url.length); | |
link.download = name?name:fileName; | |
} | |
if (document.createEvent) { | |
var e = document.createEvent('MouseEvents'); |
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
.parent { | |
width:500px; | |
height:400px; | |
background: #ffa; | |
} | |
.child { | |
display:-moz-inline-box; | |
display:inline-block; | |
vertical-align:middle; | |
zoom:1; |
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
Options +FollowSymlinks | |
RewriteEngine On | |
RewriteBase / | |
AddEncoding gzip .gz | |
RewriteCond %{HTTP:Accept-encoding} !gzip | |
RewriteRule ^(.*)\.(css|js)?$ $1.src.$2 [QSA,L] | |
RewriteCond %{HTTP_USER_AGENT} Konqueror | |
RewriteRule ^(.*)\.(css|js)?$ $1.src.$2 [QSA,L] | |
<IfModule mod_headers.c> | |
<FilesMatch .*\.(js|css)$> |