Skip to content

Instantly share code, notes, and snippets.

@ilagnev
ilagnev / console-features.js
Last active January 6, 2017 14:16
some useful browser console commands
// some features to remember from this vid
// https://youtube.com/watch?v=4mf_yNLlgic
// more info here: https://developers.google.com/web/tools/chrome-devtools/
// log time diff
console.time('test');
console.timeEnd('test');
// show element as tree with dir
console.log(document);
@ilagnev
ilagnev / console.log-rainbow.js
Created November 24, 2016 11:04
painting console log output
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31px hsl(167.4, 100%, 5
#!/bin/sh
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt -config /etc/nginx/ssl/openssl.conf
@ilagnev
ilagnev / spacebar-repeater.scpt
Created October 16, 2015 20:25
emulate spacebar press. very useful for coub 😍
activate application "Google Chrome"
repeat 999 times
tell application "System Events"
key code 49
end tell
delay 15
end repeat
javascript:
$('header').remove();
$('.wkly__header').remove();
window.blocks.clientsideTimeline.TimelineViewList.prototype.getPlayingCoubMedian = function(){return 0;};
clientsideTimeline.ClientsideTimeline.constructIn();
@ilagnev
ilagnev / sc.js
Last active April 14, 2016 18:58
add js to page
var sc = document.createElement('script');
sc.setAttribute('src','http://example.com/site.js');
document.head.appendChild(sc);
@ilagnev
ilagnev / mysql db size
Created February 4, 2014 16:17
mysql db size
SELECT table_schema AS "Data Base Name",
sum( data_length + index_length ) / 1024 / 1024 AS "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;
#!/bin/sh
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@ilagnev
ilagnev / vk.donwload.sh
Last active December 13, 2015 18:59
vk.com music download, save audio page as audio.html and run shell command
egrep -o "http[^,]+.mp3" audio.html | xargs wget