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
from totp_auth import TotpAuth | |
def main(secret=None): | |
if not secret: | |
# WHEN SIGN UP | |
ta = TotpAuth() | |
else: | |
# WHEN SIGN IN | |
ta = TotpAuth(secret) |
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
// ==UserScript== | |
// @name Ftp-Airnet-Kinopoisk helper | |
// @namespace http://airnet.lan/ | |
// @version 0.1 | |
// @description airnet helper for kinopoisk | |
// @include ftp://ftp.airnet.lan/Video/* | |
// ==/UserScript== | |
var list = document.getElementsByTagName('table'); | |
var el = list[0].getElementsByTagName('tr'); |
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
[user] | |
name = <SOME USERNAME> | |
email = <SOME EMAIL> | |
[github] | |
user = <SOME USERNAME> | |
token = <SOME TOKEN> | |
[core] | |
whitespace = trailing-space, space-before-tab, cr-at-eol |
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
from django.db import connection | |
exclude_tables = ("example", ) | |
c = connection.cursor() | |
c.execute("SHOW TABLE STATUS WHERE ENGINE='MyISAM'") | |
for line in c.fetchall(): | |
table_name = line[0] | |
if table_name in exclude_tables: |
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 python | |
""" | |
Simple sms-sender via LittleSMS | |
--------------------------------- | |
You must specify your ``USER_EMAIL`` and ``USER_APIKEY`` below. | |
Examples:: | |
$ sendsms.py --recipients=79117654321,79317654321 --message="Some message" |
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
function(url, params) { | |
var parser = document.createElement('a'); | |
parser.href = url; | |
var chunks = []; | |
for(var param in params) { | |
chunks.push(encodeURIComponent(param) + "=" + encodeURIComponent(params[param])); | |
} | |
parser.search = (parser.search ? parser.search + '&' : '?') + chunks.join("&"); | |
return parser.href; | |
} |
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
sudo su | |
apt install -y python-pip | |
git clone https://github.com/google/google-api-python-client | |
cd google-api-python-client | |
python setup.py install install_egg_info | |
pip install gdrivefs | |
cd /sbin | |
ln -s /usr/local/bin/gdfs mount.gdfs | |
echo "/root/.gdfs.creds /mnt/gdrivefs gdfs allow_other,big_writes 0 0" >> /etc/fstab | |
gdfstool auth -u |
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
function sleep (seconds) { | |
let start = new Date; | |
while (((new Date) - start) / 1000 < seconds) {} | |
} | |
// console.log('Start', new Date) | |
// sleep(5) | |
// console.log('End', new Date) | |
module.exports = { sleep } |
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
In [1]: from git import Repo, Commit | |
In [2]: repo = Repo('/tmp/xxx') | |
In [3]: list(repo.iter_commits('master', 'README.md', max_count=1))[0].author | |
Out[3]: <git.Actor "Mikhail Andreev (adw0rd) <x11org@gmail.com>"> |
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
% curl "https://api.github.com/repos/smappi/smappi/commits?path=README.md"|head -n42 | |
{ | |
"sha": "01379e9475822e439749dbfc0ef3d9bcc4939601", | |
"node_id": "MDY6Q29tbWl0MTA4MTM0MDU3OjAxMzc5ZTk0NzU4MjJlNDM5NzQ5ZGJmYzBlZjNkOWJjYzQ5Mzk2MDE=", | |
"commit": { | |
"author": { | |
"name": "Mikhail Andreev", | |
"email": "x11org@gmail.com", | |
"date": "2018-07-13T12:10:50Z" |
OlderNewer