Skip to content

Instantly share code, notes, and snippets.

View getjump's full-sized avatar

Pavel Savinov getjump

View GitHub Profile
version: '2'
services:
web:
build:
context: ./
dockerfile: docker/web.docker
volumes:
- ./:/var/www
ports:
- "${DOCKER_WEB_PORT}:80"
@getjump
getjump / jekyll_encrypt.rb
Last active May 17, 2018 00:13
Jekyll Encryption
require 'openssl'
require 'base64'
require 'digest'
require 'bcrypt'
def bin2hex(str)
str.unpack('C*').map{ |b| "%02x" % b }.join('')
end
def hex2bin(str)
{% if page.encrypted %}
{% asset jsencrypt.js %}
<script>
var storedEncrypted = '';
function decrypt() {
var key = window.location.hash.substr(1);
var text = storedEncrypted;
var data = [];
var job = function() {
$('span.title a').each(function(i, x) { data.push({name: x.innerText, link: $(x).attr('href'), vimeoId: '' })})
var w = window.open();
var i = 0;
var vimeoId = null;
@getjump
getjump / fefu-ical-parser.js
Created September 22, 2019 04:24
Экспортирует расписание с личного кабинета ДВФУ в iCal для дальнейшего импорта например в Google Calendar
// ЗАПУСКАТЬ ОТСЮДА: https://univer.dvfu.ru/schedule
// Проверено на работоспособность в Firefox
// Копировать в консоль, сохранить файл, импортировать например в Google Calendar
(async function() {
var semesterStart = '2019-09-23';
var semesterEnd = '2020-01-03';
// Function to download data to a file
const http = require('http');
const { Sema } = require('async-sema');
const REPEAT_COUNT = 100;
const s = new Sema(500, {
capacity: 100000000
});
package main
import (
"fmt"
"net/http"
"runtime"
"sort"
"sync"
"time"
)
@getjump
getjump / strace.log
Created October 30, 2021 02:12
Hardware Accelerated Video Decoding on Wayland, Nvidia 495.44 strace + Core Dump
execve("/sbin/vainfo", ["vainfo"], 0x7fffa7997090 /* 47 vars */) = 0
brk(NULL) = 0x5640b656c000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffd508416c0) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=144684, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 144684, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6e6e530000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libva.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
@getjump
getjump / test_unserializer.py
Created November 2, 2021 01:15
Python Unserializer
"""Tests for hello function."""
import pytest
from rostelecom_key.unserializer import JsonUnserializer, DatetimeFormat
from typing import Optional, List, Union
import datetime
from enum import Enum
import aiohttp
import asyncio
import logging
import time
from pyppeteer import launch
from urllib.parse import urlparse, parse_qs
from bs4 import BeautifulSoup