Skip to content

Instantly share code, notes, and snippets.

View notpushkin's full-sized avatar
🕊️

Alexander Pushkov notpushkin

🕊️
View GitHub Profile
An SSH key to connect to GitLab.com. Can read any public repos.
Public counterpart (feel free to add to your Git hostings as well):
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDFlf7wWgBodc2IAnKweYK6qXR81h7S/6+FUkugxvuTm
@notpushkin
notpushkin / bpmtools.py
Created December 23, 2020 22:56
Double or halve stepchart BPM
def to_pairs(xs):
seq = iter(xs)
while True:
try:
x = next(seq)
except StopIteration:
return
try:
y = next(seq)
except StopIteration:
TOKEN="" # get yours at https://open-vsx.org/user-settings/tokens
temp_file="$(mktemp)"
namespace="${1?usage\: $(basename $0) NAMESPACE PACKAGE_NAME}"
package_name="${2?usage\: $(basename $0) NAMESPACE PACKAGE_NAME}"
version="$(curl "https://vscode-marketplace-api.herokuapp.com/${namespace}/${package_name}" | jq -r .Version)"
echo "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${namespace}/vsextensions/${package_name}/${version}/vspackage"
curl --compressed "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${namespace}/vsextensions/${package_name}/${version}/vspackage" > "${temp_file}"
@notpushkin
notpushkin / prigorod-client.js
Created June 8, 2020 00:42
API для покупки билетов на электрички РЖД (протестировано на СЗППК)
import { stringify as qs } from "querystring";
const API_V3_1 = "https://mobile.svrpk.ru/v3.1/api.php";
const API_MOBILE_USERS = "https://mobile.svrpk.ru/mobile_users/api.php";
export default class PrigorodClient {
static getApiToken() {
return fetch(
API_V3_1 +
"?" +
@notpushkin
notpushkin / README.md
Last active June 18, 2020 08:21
Docker OpenAPI schema converted from https://docs.docker.com/engine/api/v1.40.yaml for use with Swagger UI

Open with Swagger UI: v1.40

@notpushkin
notpushkin / docker-enhanced-manpages.py
Last active June 7, 2020 01:15
Enhanced manpage generator for Docker (WIP prototype)
#: Takes data from https://github.com/docker/docker.github.io/blob/master/_data/engine-cli/
#: and produces markdown suitable for conversion to a manpage (e. g. using pandoc).
template = lambda cmd: f"""
%docker-{cmd["command"].replace(" ", "-")}(1)
# NAME
docker {cmd["command"]} - {cmd["short"]}
# SYNOPSIS
diff --git a/node_modules/sapper/runtime/app.mjs b/node_modules/sapper/runtime/app.mjs
index 6dd39c7..602bfdf 100644
--- a/node_modules/sapper/runtime/app.mjs
+++ b/node_modules/sapper/runtime/app.mjs
@@ -356,7 +356,7 @@ async function hydrate_target(target)
}
function load_css(chunk) {
- const href = `client/${chunk}`;
+ const href = initial_data.baseUrl + `/client/${chunk}`;
@notpushkin
notpushkin / npmjs-explore.user.js
Last active April 6, 2021 21:21
Redirect from npm's Explore link to https://unpkg.com/browse/*/, which is available for all ✨
// ==UserScript==
// @name npmjs.com Explore → unpkg.com Browse
// @author Alexander Pushkov <[email protected]>
// @version 2
// @grant none
// @include http://npmjs.com/package/*
// @include https://npmjs.com/package/*
// @include http://www.npmjs.com/package/*
// @include https://www.npmjs.com/package/*
// ==/UserScript==
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2020-03-31T18:03:46.844Z",
"redirects": [
{
"description": "Zoom → Zoom in-browser call",
"exampleUrl": "https://test.zoom.us/j/1234567890",
"exampleResult": "https://test.zoom.us/wc/join/1234567890",
"error": null,
"includePattern": "(https?://.*\\.zoom\\.us)/j/(.*)",