Skip to content

Instantly share code, notes, and snippets.

@zeevro
zeevro / unikey.c
Last active Jan 1, 2018
A simple utility to simulate typing of unicode characters in Windows
View unikey.c
/*
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>
View privacy.md

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 / terminfo.txt
Created Feb 3, 2019
This fixes curses problems in WSL - run "tic terminfo.txt -o ~/.terminfo/"
View terminfo.txt
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,
@zeevro
zeevro / gnu_argparse.py
Created Feb 4, 2019
Hack to enable Gnu-style long options in python's argparse
View gnu_argparse.py
#!/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 / README.md
Last active Nov 8, 2021
Pebble SDK installation script
View README.md

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 / grep-win64-build.sh
Last active Nov 16, 2021
Build grep for Windows
View grep-win64-build.sh
#!/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)