Skip to content

Instantly share code, notes, and snippets.

View kilork's full-sized avatar
🦀
Relaxing

Alexander Korolev kilork

🦀
Relaxing
View GitHub Profile
@kilork
kilork / Dockerfile
Last active July 31, 2021 18:20
Dockerfile to build armv6 for RaspberryPi Zero
# based on https://github.com/Pro/raspi-toolchain
FROM ubuntu:20.04 as builder
# This should match the one on your raspi
ENV GCC_VERSION gcc-8.3.0
ENV GLIBC_VERSION glibc-2.28
ENV BINUTILS_VERSION binutils-2.31.1
ARG DEBIAN_FRONTEND=noninteractive
package org.kilork.openiddemo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class DemoWebConfiguration implements WebMvcConfigurer {
private final String allowedOrigin;
@kilork
kilork / Cargo.toml
Last active January 16, 2022 17:06
idispatch com
[package]
name = "rust-simple-idispatch"
version = "0.1.0"
authors = ["Alexander Korolev <kilork@yandex.ru>"]
edition = "2018"
[dependencies]
# com = { version = "0.3", features = [ "production" ] }
com = { git = "https://github.com/microsoft/com-rs", features = [ "production" ] }
winapi = { version = "0.3", features = [ "minwindef", "oaidl", "oleauto", "winnt", "wtypes", "wtypesbase" ] }
@kilork
kilork / curl
Last active May 27, 2020 08:26
Retry-After tests
$ curl --version
curl 7.70.0 (x86_64-w64-mingw32) libcurl/7.70.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.40.0
Release-Date: 2020-04-29
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS brotli HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink MultiSSL NTLM PSL SPNEGO SSL SSPI TLS-SRP
$ curl -v -L --retry 4 -H "Content-Type: application/json" --data '{"hello":"world"}' http://localhost:8000/report/generate
* Trying ::1:8000...
* Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
DEVICE=${DEVICE:-video0}
WATERMARK=`date +%s`
CAPTURE_FILE=${WATERMARK}_screencast.mp4
CAPTURE_FILE_CAM=${WATERMARK}_capture_${DEVICE}_tmp.mp4
CAPTURE_FILE_SCREENGRAB=${WATERMARK}_screencast_tmp.mp4
echo Start capture $WATERMARK with cam $CAPTURE_FILE_CAM and screengrab $CAPTURE_FILE_SCREENGRAB
DEVICE=$DEVICE ./capture_cam.sh $WATERMARK $CAPTURE_FILE_CAM &> /dev/null &
ID_CAM=$!
./capture_screen.sh $WATERMARK $CAPTURE_FILE_SCREENGRAB &> /dev/null &
ID_SCREEN=$!
@kilork
kilork / toUriParameter.js
Created May 19, 2011 05:07
toUriParameter
function toUriParameter(obj, post) {
var key, value,
parts = [],
encode = post ? function(s) {
return window.encodeURIComponent(s).replace(/%20/g,'+');
} : window.encodeURIComponent,
iterator = function(item) {
parts.push(encode(key) + '=' + encode(item));
};
http://codefaces.org/explore
http://www.coderun.com/
http://shiftedit.net/
http://cloud9ide.com/
http://jsfiddle.net/
http://ideone.com/
http://jsbin.com/
http://pascalabc.net/WDE/
http://www.eclipse.org/orion/
var input = new qx.ui.form.TextArea('log');
doc.add(input, {
left: 10,
top: 50,
bottom: 10
});
var str1 = "strwithnot";
var str2 = "strxihtnot";
function log(s) {