Skip to content

Instantly share code, notes, and snippets.

View zeevro's full-sized avatar

Zeev Rotshtein zeevro

View GitHub Profile
@zeevro
zeevro / K3-Pro-ANSI-White-v1.0-fixed.json
Created December 22, 2022 21:17
Fixed version of the Keychron K3 Pro white-backlight VIA JSON file
{
"name": "Keychron K3 Pro",
"vendorId": "0x3434",
"productId": "0x0233",
"lighting": {
"extends": "none",
"keycodes": "qmk"
},
"customKeycodes": [
{"name": "Left Option", "title": "Left Option", "shortName": "LOpt"},
@zeevro
zeevro / cmd-ansi-escapes-by-default.reg
Created May 31, 2022 18:45
Enable Windows cmd.exe ANSI escapes support by default
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
"VirtualTerminalLevel"=dword:00000001
@zeevro
zeevro / grep-win64-build.sh
Last active November 16, 2021 23:36
Build grep for Windows
#!/bin/sh
latest=$(curl -sL https://ftpmirror.gnu.org/grep/ | grep -oE 'grep-[0-9]+\.[0-9]+(\.[0-9]+)?' | sort | tail -n 1)
wget "https://ftpmirror.gnu.org/grep/${latest}.tar.gz"
tar -xf "${latest}.tar.gz"
cd $latest
LDFLAGS=/usr/x86_64-w64-mingw32/lib/CRT_glob.o ./configure --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu --enable-threads=windows
make -j$(nproc)
@zeevro
zeevro / README.md
Last active November 8, 2021 08:30
Pebble SDK installation script

Now that Pebble servers are gone, some old components in the SDK need to be patched or replaced so they can fetch what they need from Rebble.

This script downloads and installes everything needed to build projects and also run the emulator.

Was tested on Ubuntu 18.04.2 on WSL.

@zeevro
zeevro / gnu_argparse.py
Created February 4, 2019 20:14
Hack to enable Gnu-style long options in python's argparse
#!/usr/bin/python3
import argparse
import inspect
class GnuStyleLongOption(argparse._StoreConstAction):
def __init__(self, **kw):
self._real_option_strings = kw['option_strings']
opts = []
for option_string in self._real_option_strings:
opts.append(option_string)
@zeevro
zeevro / terminfo.txt
Created February 3, 2019 10:29
This fixes curses problems in WSL - run "tic terminfo.txt -o ~/.terminfo/"
xterm-256color|xterm with 256 colors,
am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
colors#0x100, cols#80, it#8, lines#24, pairs#0x7fff,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,

Privacy Policy

built the ZFlash app as an Open Source app. This SERVICE is provided by at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at ZFlash unless otherwise defined in this Privacy Policy.

@zeevro
zeevro / unikey.c
Last active January 1, 2018 16:18
A simple utility to simulate typing of unicode characters in Windows
/*
Compilation instructions:
1. Open VS developer console
2. cl.exe /Feunikey.exe unikey.c
3. You're done. It's that simple. :)
*/
#include <windows.h>
#include <stdio.h>