Skip to content

Instantly share code, notes, and snippets.

Avatar
🗿
мы ВАЙБИН здесь

Alexander Pushkov notpushkin

🗿
мы ВАЙБИН здесь
View GitHub Profile
View lenta.com basic promotions API.md

lenta.com basic promotions API

  • Get your store id at https://lenta.com/api/v1/stores/
  • Grab promoted goods info at:
    https://lenta.com/api/v1/stores/<store_id>/home
    https://lenta.com/api/v1/stores/<store_id>/crazypromotions
    https://lenta.com/api/v1/stores/<store_id>/mobilepromo?hideAlcohol=false&limit=15&offset=0&type=weekly
    
View mtproto-ssl.nginx.conf
user www-data;
worker_processes auto;
events {
worker_connections 4096;
}
http {
include /etc/nginx/mime.types.conf;
default_type application/octet-stream;
@jtratner
jtratner / generate_typed_dicts.py
Created Apr 10, 2018
Example of auto generating type stubs
View generate_typed_dicts.py
from datetime import datetime
STRING_DEFAULT = 'string'
DATETIME_DEFAULT = datetime(2015, 1, 1)
INT_DEFAULT = 123
def generate_typed_dicts(name, nested_dict):
full_context = []
final_dict = [f"class {name}(TypedDict):"]
View 1-future-ideas.js
const React = require("react");
const Lifecycles = React.createLifecycleEvents({
didMount({ setState }) {
setState({
disabled: false,
});
},
didUpdate({ inputRef }) {
if (document.activeElement !== inputRef.value) {
View Вастрик.Микстейп.txt
Fight Back - Neffex
Run Run Blood - Phantogram
Mein schönster Tag in deinem Leben - Rakede
Black Cats Ft Drakezilla & Saving Grace - Mind Over Matter
Still Alive (Teddybears Mix) - Lisa Miskovsky
6.24 - Danger
One Touch - VIP - Baauer
Pi - Käptn Peng
Birds In The Sky - Bliss n Eso
Black Barbies - Nicki Minaj
@nakanod
nakanod / .docker.env
Last active Apr 11, 2020
Pleroma docker files
View .docker.env
HOST=pleroma.example.com
SECRET_KEY_BASE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@simonw
simonw / recover_source_code.md
Last active Apr 1, 2021
How to recover lost Python source code if it's still resident in-memory
View recover_source_code.md

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@LunaSquee
LunaSquee / queue.js
Last active Feb 8, 2021
Liquidsoap radio + youtube-dl queueing (Node.js as helper)
View queue.js
// $ node queue <file name or youtube URL>
const net = require('net')
let client = net.connect(1234, 'localhost')
client.on('connect', function () {
if (process.argv[2]) {
console.log('Queueing ' + process.argv[2])
client.write('queue.push smart:' + process.argv[2] + '\r\n')
}
@sfan5
sfan5 / ttml2ass.py
Last active Oct 15, 2020
Converts TTML (XML) subtitles to SSA/ASS format
View ttml2ass.py
#!/usr/bin/env python3
import sys
from xml.dom.minidom import parseString
COLORS = { # TODO more colors
"white" : "FFFFFF",
"black" : "000000",
"yellow" : "FFFF00",
"green" : "00FF00",
"cyan" : "00FFFF",
View zsvim.txt
— Мержь код, блядь, на. Мержь код.
— Чем, vimdiff что ли?
— Мержь. Мержь код! Садись уже. Садись! Мержь!
— Блядь.
— Чтобы чисто было!
— Как я буду vim'ом-то мержить?
— Мержь!
— Покажи мне, как!
— Мержь! (Уходит.)
— Что «мержи», ёпта, как я буду vim-то мержить?! Чё, совсем мудак что ли, покажи мне, как я буду мержить-то, ёпта!