Skip to content

Instantly share code, notes, and snippets.

View nonylene's full-sized avatar
📶
On vacation

nonylene nonylene

📶
On vacation
View GitHub Profile
@nonylene
nonylene / Dockerfile
Last active October 23, 2024 17:01
Read lyr objects using slyr_community library
FROM debian:12-slim
RUN apt update && apt install -y mdbtools python3-pip git
WORKDIR /work
RUN mkdir /work/lib
RUN git clone https://github.com/north-road/slyr.git /tmp/slyr
RUN mv /tmp/slyr/slyr_community /work/lib/slyr_community
@nonylene
nonylene / usb_hid_keys.h
Created January 31, 2022 12:32 — forked from MightyPork/usb_hid_keys.h
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@nonylene
nonylene / settings.json
Created April 16, 2021 08:27
Windows Terminal
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{wsl}",
"initialCols": 82,
"initialRows": 27,
"profiles": [
{
// Make changes here to the powershell.exe profile
@nonylene
nonylene / getcolor.swift
Created January 23, 2020 05:35
Get the system color on macOS
import Cocoa
let color = CIColor(color: NSColor.selectedTextBackgroundColor)!
color.red
color.green
color.blue
color.alpha
@nonylene
nonylene / tex_ubuntu.sh
Last active November 9, 2020 07:36
TeX ubuntu
sudo apt install texlive latexmk texlive-lang-japanese texlive-extra-utils texlive-fonts-extra
@nonylene
nonylene / json_minify.py
Created December 9, 2018 16:43
minifier
import json
import sys
import os
def minify(file_name: str):
with open(file_name) as f:
j = json.load(f)
with open(file_name + ".json", 'w') as f:
json.dump(j, f, ensure_ascii=False)
@nonylene
nonylene / openssl.log
Created July 10, 2018 14:37
OpenSSL Speed
~ > openssl speed
Doing md4 for 3s on 16 size blocks: 14191466 md4's in 3.00s
Doing md4 for 3s on 64 size blocks: 11846993 md4's in 3.00s
Doing md4 for 3s on 256 size blocks: 6964149 md4's in 3.00s
Doing md4 for 3s on 1024 size blocks: 2629962 md4's in 3.00s
Doing md4 for 3s on 8192 size blocks: 386209 md4's in 3.00s
Doing md5 for 3s on 16 size blocks: 11282155 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 8308478 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 4164276 md5's in 3.00s
Doing md5 for 3s on 1024 size blocks: 1542826 md5's in 3.00s
@nonylene
nonylene / main.js
Last active January 12, 2018 11:05
simutrans bmp color height
// https://github.com/aburch/simutrans/blob/ef2b92a0e67234812d7b4339ff8da61161da165f/dataobj/height_map_loader.h
for( i = -19; i < 20; i++ ){ console.log(`${i}, ${(i+14)*64/6}`);}
/*
VM7699:1 -19, -53.333333333333336
VM7699:1 -18, -42.666666666666664
VM7699:1 -17, -32
VM7699:1 -16, -21.333333333333332
VM7699:1 -15, -10.666666666666666
VM7699:1 -14, 0
VM7699:1 -13, 10.666666666666666
@nonylene
nonylene / raw-socket.nim
Created September 27, 2017 12:38
raw-socket.nim
import net
import system
import strutils
import nativesockets
proc main(): int =
let socket = net.newSocket(AF_INET, SOCK_RAW, IPPROTO_TCP)
socket.bindAddr(address="127.0.0.1")
# IPPROTO_IP, IP_HDRINCL, true
@nonylene
nonylene / css.css
Created August 22, 2017 13:12
vimnium
div > .vimiumHintMarker {
padding: 3px 4px;
background-color: dodgerblue;
border: 0;
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.298039) 0px 4px 4px 0px;
background-image: none;
}
div > .vimiumHintMarker span {