Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
CREATE PROCEDURE [logging].[sp_log]( | |
@msg NVARCHAR(MAX) = NULL | |
, @cnt BIGINT = NULL | |
, @proc NVARCHAR(256) = NULL | |
) | |
AS | |
BEGIN | |
/* | |
<summary> | |
Microsoft SQL Server NoLock logging |
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
javascript:void((function(){ | |
var a = document.createElement('button'); | |
a.className = 'title-copier'; | |
a.innerText = 'Copy title'; | |
a.style.position = 'fixed'; | |
a.style.top = '1em'; | |
a.style.left = '1em'; | |
a.style.zIndex = '999'; |
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
javascript: void((function(){ | |
var rulers = document.getElementsByClassName('js-pro.logvinenko.js.ruler'); | |
if (rulers.length > 0) { | |
document.removeEventListener('mousemove', moveRuler); | |
var ruler = rulers[0]; | |
document.body.style.cursor = ruler.getAttribute('data-cursor'); | |
document.body.removeChild(ruler); | |
ruler = null; | |
} else { | |
var ruler = document.createElement('div'); |
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
import logging | |
logging.basicConfig(level=logging.INFO) | |
def measure_time(func): | |
def wrapper(*args, **kwargs): | |
f = datetime.datetime.fromtimestamp |
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
(insert (?: \s (?:bulk|into))?) \s | |
(?(?=openquery) (?: | |
(openquery) \s \( | |
(\S+?) \, \s \' .+? \'\) | |
) | |
| (\S+) | |
) | |
.+? | |
select |
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
#!/usr/bin/env python3 | |
"""Export Apache Airflow connections | |
Run under `airflow` user (or another user owns an `airflow` DB) inside its home directory. Like a: | |
[dm-logv@airflow ~]$ sudo -u airflow /bin/bash | |
[airflow@airflow dm-logv]$ cd ~ | |
[airflow@airflow ~]$ chmod +x export_airflow_connections.py | |
[airflow@airflow ~]$ ./export_airflow_connections.py > secrets.py |
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
echo "du /yandex/users" | xmllint --shell /etc/clickhouse-server/users.xml | grep -e '^ \w' | tr -d ' ' | sort |
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
// Ctrl+Shift+C to open Chrome Console. | |
// Choose an IFrame of the Vimeo Video with a comment `player.vimeo.com` | |
// in the drop-down list `top`. | |
// Run a script: | |
var videos = []; | |
$$('script')[3].textContent.match(/\{[^{]+?mp4[^}]+?\}/g).forEach( | |
x => { o = JSON.parse(x); | |
videos.push(o);}); | |
videos.sort((a, b) => a.quality.localeCompare(b.quality)).forEach( |
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
$$('h2,h3').forEach(el => { | |
if (el.hasAttribute('id')) { | |
console.log(`- [${el.innerText}](#${el.id})`); | |
} | |
}) |