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'); | |
} |
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
#!/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
$('.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
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
-- function returns random string key like: cg8rP, QUdfX, 4veH7 | |
CREATE OR REPLACE FUNCTION you_id() | |
RETURNS varchar AS $$ | |
DECLARE | |
num FLOAT; | |
key TEXT; | |
bin BYTEA; | |
BEGIN |
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
let g:netrw_banner = 0 | |
let g:netrw_liststyle = 3 | |
let g:netrw_browse_split = 4 | |
let g:netrw_altv = 1 | |
let g:netrw_winsize = 25 |
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
import 'dart:convert'; | |
import "dart:io"; | |
import 'package:html/dom.dart'; | |
import 'package:html/parser.dart' as parser; | |
import "package:http/http.dart" as http; | |
import 'package:http/http.dart'; | |
import "package:yaml/yaml.dart"; | |
main() async { |
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
# List samba shares | |
smbclient -L 192.168.1.189 -U depidsvy | |
# mount NFS | |
sudo mount 192.168.1.189:/volume1/photo /media/nas/photo | |
# mount samba share to a folder | |
sudo mount -t cifs -o username=depidsvy,password=$pw,uid=slawa,gid=users //192.168.1.189/photo /media/nas/photo2 | |
# mount SFTP |
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
// you can run this tutorial - it's executable | |
// fake function for demonstration | |
async function fetchSomething(item) { | |
return item; | |
} | |
async function learnLoops() { | |
// let's have some simple array first | |
// note that each value has also an 0-base index |
OlderNewer