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 print_r(arr, level) { | |
var print_red_text = ""; | |
if(!level) level = 0; | |
var level_padding = ""; | |
for(var j=0; j<level+1; j++) level_padding += " "; | |
if(typeof(arr) == 'object') { | |
for(var item in arr) { | |
var value = arr[item]; | |
if(typeof(value) == 'object') { | |
print_red_text += level_padding + "'" + item + "' :\n"; |
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)$> |
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
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
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
.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
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
<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
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
const throttle = (callback, limit) => { | |
let wait = false | |
return function() { | |
if (!wait) { | |
callback.call(this) | |
wait = true | |
setTimeout(() => wait = false, limit) | |
} | |
} | |
} |
OlderNewer