${x}
${len(list_name)}
${pow(x,2) + pow(y,2)}
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 os = require('os') | |
const fs = require('fs') | |
const path = require('path') | |
const exec = require('child_process').exec | |
const fontsubset = function(source, text, callback) { | |
const tmp = path.join(os.tmpdir(), 'tmp.ttf') | |
const subset = `node_modules/fontsubset/bin/fontsubset -s ${text} ${source} ${tmp}` | |
const sfntedit = path.resolve(__dirname, '../assets/font/', 'sfntedit') + ' -d vhea ' + tmp |
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
graph { | |
node [shape = rect, style = rounded] | |
subgraph cluster_moscow { | |
label = "Moscow" | |
Berlioz | |
Bezdomny | |
Styopa | |
Rimsky | |
Varenukha | |
Master |
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 getCaretPos(input_node) { | |
return 'selectionStart' in input_node? input_node.selectionStart: Math.abs(document.selection.createRange().moveStart('character', -input_node.value.length)) | |
} | |
function getCaretText(input_node) { | |
var pos = getCaretPos(input_node) | |
if(!pos) return | |
return input_node.value.substring(pos - 1, pos) | |
} | |
$input_node.on('keyup', function() { | |
dosomething(getCaretText($input_node[0])) |
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
.wrapper { | |
background: url('http://daix.me/demo/img/reese.jpg') no-repeat fixed; | |
width: 900px; | |
height: 600px; | |
} | |
.lens { | |
position: relative; | |
width: 100px; | |
height: 100px; | |
top: 10%; |
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
$.unparam = function(search) { | |
var queries = search.split('&') | |
var retObj = {} | |
$(queries).each(function(index, query) { | |
var match = query.match(/([^?&]*)=([^&]*)/i) | |
if(match) { | |
retObj[match[1]] = match[2] | |
} | |
}) | |
return retObj |
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 offsets = []; | |
var curPos = 0; | |
$('#list li').each(function(i){ | |
// init : original order | |
$(this).attr('data-order',i); | |
$(this).bind('dragstart',function(event){ | |
return $( this ).css({'opacity':.5,'color':'white','border':'1px dashed #ccc'}) | |
.clone().addClass('active') | |
.insertAfter( 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
.dialog { | |
/* layout */ | |
position: absolute; | |
top: 38.20%; | |
left: 50%; | |
-webkit-transform: translate(-50%, -50%); | |
-moz-transform: translate(-50%, -50%); | |
transform: translate(-50%, -50%); | |
/* presentation */ | |
border: 0.5em solid rgba(0,0,0,0.16); |
NewerOlder