Skip to content

Instantly share code, notes, and snippets.

@da-rth
da-rth / komorebi_named_pipe.py
Created October 25, 2021 18:09
An example of how to have komorebi subscribe and send events to a named pipe in python
import win32pipe
import win32file
import pywintypes
import subprocess
import json
import time
KOMOREBI_BUFF_SIZE = 64 * 1024
KOMOREBI_PIPE_NAME = "yasb"
@f-steff
f-steff / ICD3_Switcher.cmd
Last active January 24, 2023 20:52
Batch script to switch USB drivers for the Microchip ICD3 In Circuit Debugger. Unlike the "MPLAB Drive Switcher" utility, this script supports all installation points of MPLAB8 and MPLABX, both 32 and 64 bit, and it uses only windows functionality to perform the switch, which is virtually instantaneous. Tested on Win10. Updated to support multip…
@echo off
:: ICD3 switcher by Flemming Steffensen, Febuary 2021.
:: Switch USB drivers for all Microchip ICD3 In Circuit Debugger connected to the computer.
:: Unlike the "MPLAB Drive Switcher" utility, this script supports all installation points of MPLAB8 and MPLABX,
:: both 32 and 64 bit, and it uses only windows functionality to perform the switch, which is virtually instantaneous.
:: This script is parameterized in run in command prompt and interactive when doubleclicked.
:: Tested on Win10.
::
:: Note, A known ICD3 bug appear to happen much more frequently when switching between drives. The ICD3 firmware also
:: need to be programmed, and while it can happen automatic, I recommend to not do so. If after installing the firmware,
@tvwerkhoven
tvwerkhoven / dedupe.sh
Last active September 4, 2024 08:50
De-duplicate using APFS clonefile(2) and jdupes in zsh
#!/usr/bin/env zsh
#
# # About
#
# Since APFS supports de-duplication on block-level, it can be useful to
# manually de-duplicate your files if you've migrated/upgrade to APFS not
# using a fresh install.
#
# I've written this simple script with the aim to:
# - Be simple, easy to read and understand (for users to check)
@hranicka
hranicka / project.docker-compose.yml
Created November 28, 2019 12:29
Traefik & multiple docker-compose projects
version: '3'
services:
nginx:
labels:
- "traefik.enable=true"
- "traefik.http.routers.provys-transformer.rule=Host(`www.example.com`)"
- "traefik.http.routers.provys-transformer.tls=true"
networks:
- traefik
@Gujci
Gujci / Pager.swift
Created October 15, 2019 08:50
Basic `PageControl` in SwiftUI without any UIKit components.
struct PageControl: View {
var numberOfPages: Int
@Binding var currentPage: Int
var body: some View {
HStack {
ForEach(0..<numberOfPages) { index in
Circle()
@apankrat
apankrat / readme.txt
Last active August 30, 2021 02:45
μGiffer 0.9.10 (preview)
-- μGiffer / preview release --
https://iobureau.com/files/uGiffer-0.9.12.zip (213576 bytes)
------------------------> 32-bit/uGiffer.exe (111488 bytes)
------------------------> 64-bit/uGiffer.exe (123264 bytes)
Both exe files carry an EV signature of IO Bureau SA.
For details see here -> https://iobureau.com/ugiffer
@smuda
smuda / SetupSSHForwardingOnQNAP.md
Created November 19, 2017 04:26
Setup SSH forwarding on QNAP NAS

On receiving NAS:

setcfg LOGIN "SSH AllowTcpForwarding" TRUE
reboot

On client to forward local port 8443 to the QNAP admin interface:

ssh user@host -L 8443:localhost:443
@73696e65
73696e65 / buildasn1.py
Created November 1, 2017 07:44 — forked from gnpar/buildasn1.py
Generate an asn1parse config for an RSA private key given p,q and e
#!/usr/bin/env python
import sys
helptext = """
Redirect output to asn1.conf and then create and check the key with:
openssl asn1parse -genconf asn1.conf -out key.der
openssl rsa -in key.der -inform der -text -check
"""
#### Extended Euclidean Algorithm and Modular Inverse
@lattner
lattner / TaskConcurrencyManifesto.md
Last active September 14, 2024 20:24
Swift Concurrency Manifesto
@lattner
lattner / async_swift_proposal.md
Last active September 12, 2024 07:25 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.