This file contains hidden or 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 analyze(i, callback) { | |
setTimeout(() => { | |
callback('result 123'); | |
}, Math.random()*10000); | |
// long thinking time.... | |
// callback('result 123'); | |
} | |
async function analyzeAsync(i) { | |
return new Promise((resolve, reject) => { |
This file contains hidden or 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
$('.POSITIVE').map((i, el) => { | |
let k = $(el).text().replace('EUR ', ''); | |
return parseInt(k); | |
}).get().reduce((a, b) => a + b, 0) | |
/$('.POSITIVE').length |
This file contains hidden or 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
#!/bin/bash | |
year=2018 | |
for i in `seq -f "%02g" 1 12`; | |
do | |
mask="???_$year$i*"; | |
folder="$year-$i/"; | |
mkdir -p $folder; | |
echo "" | |
echo -e "mv \t $mask \t $folder"; | |
mv $mask $folder; |
This file contains hidden or 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 | |
use RandomLib\Factory; | |
class MyRandomFactory extends Factory { | |
public function __construct() { | |
parent::__construct(); | |
$this->mixers = []; | |
$this->registerMixer('OpenSSLMixer', OpenSSLMixer::class); |
This file contains hidden or 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 () { | |
function setVideoEndHandler() { | |
let iframeDocument = window | |
.frames['contentContainer'] | |
.contentDocument; | |
let video = iframeDocument.querySelector('video'); | |
if (!video) { | |
video = iframeDocument.querySelector('audio'); | |
} |
NewerOlder