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
<?php | |
# some function in some php-file meant to be used as a module | |
function myFunc(param) { | |
echo param; | |
} | |
# testing function from module in that module | |
# so that it does not impact the usage elsewhere | |
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) myFunc(); |
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 recordsFrom(data) { | |
try { var [headers, rows] = data } | |
catch { var {headers, rows} = data } | |
return rows.map(row => { | |
let obj = {} | |
row.forEach((value,i) => obj[headers[i]] = value) | |
return obj | |
}) | |
} |
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 get(temp) { | |
var text = temp.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.children[1].innerText, | |
end = text.search('","cdn":"akamai_interconnect","quality":"720p')+1 || text.search('","cdn":"fastly","quality":"720p')+1, | |
begin = text.substring(0,end).lastIndexOf('https') | |
return text.substring(begin,end-1) | |
} | |
get(temp1) |
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
// Place your key bindings in this file to override the defaultsauto[] | |
[ | |
{ | |
"key": "ctrl+shift+/", | |
"command": "editor.action.blockComment", | |
"when": "editorTextFocus && !editorReadonly" | |
}, | |
{ | |
"key": "shift+alt+a", | |
"command": "-editor.action.blockComment", |
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
#accede #beaded #bedded #bedead #beebee #beefed #cabbed #dabbed #decade #deeded | |
#deface #efface #facade #aced #babe #bead #beef #cafe #dead #deaf #deed #face | |
#fade #feed #ace #add #baa #bad #bed #bee #cab #cad #cee #dab #dad #dee #ebb | |
#eff #fad #fed #fee #abba | |
#123456 | |
#234567 | |
#345678 | |
#456789 | |
#567890 | |
#098765 |
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
`.selector { | |
property1: value; | |
property2: value; | |
} | |
#selector { property: value }` | |
.match(/[^{]+{[^}]+\}/g).forEach(rule => d.styleSheets[0].insertRule(rule)) |
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, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, ª, µ, º, À, Á, Â, Ã, Ä, Å, Æ, Ç, È, É, Ê, Ë, Ì, Í, Î, Ï, Ð, Ñ, Ò, Ó, Ô, Õ, Ö, Ø, Ù, Ú, Û, Ü, Ý, Þ, ß, à, á, â, ã, ä, å, æ, ç, è, é, ê, ë, ì, í, î, ï, ð, ñ, ò, ó, ô, õ, ö, ø, ù, ú, û, ü, ý, þ, ÿ, Ā, ā, Ă, ă, Ą, ą, Ć, ć, Ĉ, ĉ, Ċ, ċ, Č, č, Ď, ď, Đ, đ, Ē, ē, Ĕ, ĕ, Ė, ė, Ę, ę, Ě, ě, Ĝ, ĝ, Ğ, ğ, Ġ, ġ, Ģ, ģ, Ĥ, ĥ, Ħ, ħ, Ĩ, ĩ, Ī, ī, Ĭ, ĭ, Į, į, İ, ı, IJ, ij, Ĵ, ĵ, Ķ, ķ, ĸ, Ĺ, ĺ, Ļ, ļ, Ľ, ľ, Ŀ, ŀ, Ł, ł, Ń, ń, Ņ, ņ, Ň, ň, ʼn, Ŋ, ŋ, Ō, ō, Ŏ, ŏ, Ő, ő, Œ, œ, Ŕ, ŕ, Ŗ, ŗ, Ř, ř, Ś, ś, Ŝ, ŝ, Ş, ş, Š, š, Ţ, ţ, Ť, ť, Ŧ, ŧ, Ũ, ũ, Ū, ū, Ŭ, ŭ, Ů, ů, Ű, ű, Ų, ų, Ŵ, ŵ, Ŷ, ŷ, Ÿ, Ź, ź, Ż, ż, Ž, ž, ſ, ƀ, Ɓ, Ƃ, ƃ, Ƅ, ƅ, Ɔ, Ƈ, ƈ, Ɖ, Ɗ, Ƌ, ƌ, ƍ, Ǝ, Ə, Ɛ, Ƒ, ƒ, Ɠ, Ɣ, ƕ, Ɩ, Ɨ, Ƙ, ƙ, ƚ, ƛ, Ɯ, Ɲ, ƞ, Ɵ, Ơ, ơ, Ƣ, ƣ, Ƥ, ƥ, Ʀ, Ƨ, ƨ, Ʃ, ƪ, ƫ, Ƭ, ƭ, Ʈ, Ư, ư, Ʊ, Ʋ, Ƴ, ƴ, Ƶ, ƶ, Ʒ, Ƹ, ƹ, ƺ, ƻ, Ƽ, ƽ, ƾ, ƿ, ǀ, ǁ, ǂ, ǃ, DŽ, Dž, dž, LJ, Lj, lj, NJ, Nj, nj, Ǎ, ǎ, Ǐ, ǐ, Ǒ, ǒ, Ǔ, ǔ, Ǖ, ǖ, Ǘ, ǘ, Ǚ, ǚ, Ǜ, ǜ, ǝ, Ǟ |
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
// short version I prefer | |
const wait = (stream, parts=[])=> new Promise((resolve, reject)=> | |
stream.on('error', reject).on('data', part => parts.push(part)) | |
.on('end', ()=> resolve(Buffer.concat(parts).toString('utf8')))) | |
// usage example | |
wait(req).then(body => console.log(body)) | |
// original by Marlon Bernardes | |
function streamToString (stream) { |
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
// leave only one version and delete the rest, or it will throw a (nonbreaking) error | |
// full version: with all 11 getters and time | |
{ | |
let lastTime | |
const logger = label => function() { | |
const time = new Date().toLocaleTimeString('en', {hour12: false}) | |
console.log(time == lastTime? '':lastTime=time, label || '', this.valueOf(), | |
this instanceof Node? {dir: this}: '')) | |
return this.valueOf() |
OlderNewer