Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="background.js"></script>
</head>
<body>
<textarea id="ta"></textarea>
</body>
</html>
@ilagnev
ilagnev / enable-right-click.js
Created February 16, 2017 10:43
enabling right click context menu on sites which disabled it
javascript:void(document.oncontextmenu=null);
@ilagnev
ilagnev / docker-gc.sh
Last active March 19, 2023 03:06
docker clean up stopped containers and remove unlinked images
#!/usr/bin/sh
# info
docker system df # Show docker disk usage, including space reclaimable by pruning
# automatic clean up
docker system prune # will delete ALL unused data
# (i.e. In order: containers stopped, volumes without containers and images with no containers)
# manual clean up
docker container prune # Remove all stopped containers
<!--https://habrahabr.ru/post/333372/-->
<pre id=p><script>n=setInterval("for(n+=7,i=k,P='p.\\n';i-=1/k;P+=P[i%2?(i%2*j-j+n/k^j)&1:2])j=k/i;p.innerHTML=P",k=64)</script>
@ilagnev
ilagnev / sql-mongo_comparison.md
Created October 31, 2017 22:54 — forked from aponxi/sql-mongo_comparison.md
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@ilagnev
ilagnev / add-hash-to-config.js
Created December 13, 2017 22:00
Read json, add hash uid, save json
const crypto = require('crypto');
const fs = require('fs');
const hash = data => crypto.createHash('sha1').update(data).digest('hex');
const usedHashes = [];
fs.readFile('config.json', (err, data) => {
const json = JSON.parse(data.toString());
// console.log(json);
addUid(json);
@ilagnev
ilagnev / async.js
Created December 27, 2017 07:46
asynced async :)
async = async async => async;
async('test');
@ilagnev
ilagnev / nodejs-test-task-2.js
Created January 16, 2018 16:40
lazy test task solution for nodejs course
const WebSocket = require('ws');
const rpn = require('rpn');
const ws = new WebSocket('ws://rpn.javascript.ninja:8080');
ws.on('message', data => data.includes('Token') && !console.log(data) || ws.send(rpn(data)));
@ilagnev
ilagnev / burn-iso.sh
Created March 25, 2018 08:21
burn iso to usb
$ diskutil list
$ diskutik umount /dev/disk#s#
$ sudo dd if=image.iso of=/dev/disk#s# bs=1m