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 compileTemplate(templateElement, data){ | |
//hack to get unencoded symbols from HTML node | |
var textarea = document.createElement('textarea'); | |
textarea.innerHTML = templateElement.innerHTML; | |
var text = eval("with(data){html`" + textarea.value + "`}"); | |
var tmpElement = document.createElement('div'); | |
tmpElement.innerHTML = text; |
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
tar -xOf FILE.tar.bz2 | psql -h HOST -U USER -d DATABASE |
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
Download new binary from nodejs.org |
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
<title>Parcel demo</title> | |
<!-- <link rel=stylesheet href=./style.css /> --> | |
<style> | |
body { | |
max-width: 500px; | |
margin: auto; | |
} | |
#modal_holder:empty { | |
display: none; | |
} |
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 fetch = (...args) => console.log(...args) // mock | |
function httpRequest(url, method, data) { | |
const init = { method } | |
switch (method) { | |
case 'GET': | |
if (data) url = `${url}?${new URLSearchParams(data)}` | |
break | |
case 'POST': | |
case 'PUT': | |
case 'PATCH': |
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 model = { | |
normalKey: 1, | |
coRRupTkey: 2, | |
innErKey: { | |
x: 3, | |
Y: 4 | |
}, | |
aRR: [ | |
{ first: 5 } | |
] |
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
<title>JS node editor</title> | |
<link rel="stylesheet" href="style.css"> | |
<div class=node style='left:50px; top: 50px;'> | |
<div class='in'>input label</div> | |
<div class='out'>output label</div> | |
</div> | |
<svg class=link width=50 height=127 style='left:350px;top: 95px'> | |
<path d="M 0 0, C 50 0, 00 127, 50 127" /> |
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
from random import randrange | |
from ortools.algorithms import pywrapknapsack_solver | |
PLAYERS_COUNT = 6 | |
PLAYERS_IN_MATCH = 6 | |
regions = { | |
'eu': 0, | |
'na': 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
var values = Array.from('AKQJT98765432') | |
// values.map(j => `${values[Math.min(i,j)]}${values[Math.max(i,j)]}${i > j ? 's' : i < j ? 'o' : ''}`).join(', ') | |
var result = values.map( | |
(_,i) => values.map( | |
(_,j) => `${values[Math.min(i,j)]}${values[Math.max(i,j)]}${i > j ? 's' : i < j ? 'o' : ''}`.padEnd(4) | |
).join('') | |
).join('\n') | |
console.log(result) | |
/* |
OlderNewer