Skip to content

Instantly share code, notes, and snippets.

View imsmith's full-sized avatar

Ian Smith imsmith

  • Seattle
  • 21:10 (UTC -07:00)
View GitHub Profile
@guest271314
guest271314 / filestream.md
Created September 10, 2023 15:53
Creating a FIFO-type file stream pipe between the browser and local applications

Today we are going to create a FIFO (First In First Out) type file stream between the browser and a local application.

The idea is to create a local file in the browser, when the file is created the local application writes data to the newly created file, in the browser we will read the data written to the file up to that point, then truncate the file to size 0, repeat, when the writing and reading of the file are complete we will remove the file from the local file system.

In this way we can configure our local application to watch for the creation of specific named files, each performing a discrete process, and stream data from the local application to the file, without using networking.

We'll be using Deno in this example for the local application. Use whatever local application you want. Node.js, QuickJS, C,

@clly
clly / Actual Caddyfile
Created August 4, 2023 01:53
Dockerfile, Caddyfile, and github action
{
auto_https off
}
:443 {
bind tailscale+tls/app
handle / {
reverse_proxy / http://192.168.1.1:29552
}
@evadne
evadne / lecture.md
Last active October 4, 2023 23:24
How to Sell Elixir (2023)

How to Sell Elixir AGAIN (2023)

Presented by Evadne Wu at Code BEAM Lite in Stockholm, Sweden on 12 May 2023

Synopsis

We have celebrated 10 years of Elixir and also nearly 25 years of Erlang since the open source release in December 1998.

Most of the libraries that were needed to make the ecosystem viable have been built, talks given, books written, conferences held and training sessions provided. A new generation of companies have been built on top of the Elixir / Erlang ecosystem. In all measures, we have achieved further reach and maturity than 5 years ago.

@ScottKillen
ScottKillen / print.css
Last active February 20, 2025 18:59
PDF export stylesheet for obsidian
/* Obsidian snippet to style output of pdf exports
*/
@media print {
/* set your preferred fonts here.
*/
:root {
--body-font-family: "Newsreader Text", TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif;
@idlehands
idlehands / 00_info.md
Last active April 4, 2025 09:20
-info and links
@gilzoide
gilzoide / clang_tu_from_ast.py
Last active February 7, 2024 21:17
Snippet for creating a clang TranslationUnit in python by calling clang as a subprocess instead of parsing with Index.parse
import subprocess
import tempfile
import clang.cindex as clang
def create_translation_unit_with_ast(source_file_path, clang_args=[], clang_exe='clang'):
"""
Create a `clang.TranslationUnit` for a source file by compiling it with clang as a
subprocess instead of using `clang.Index.parse`.
@adrianmihalko
adrianmihalko / agistfile1.txt
Last active August 29, 2022 03:41
Selective routing trough VPN with Unifi USG.
I wanted to route only specific IPs trough a Wireguard interface. I am not expert in any way, but I am trying to explain you as best I can how I did it.
Setup a WG connection as usual on one of your device in your network (In my example I will call it "Ubuntu server", 192.168.1.54):
[Interface]
Address = something/24
PrivateKey = longprivatekeyR5FE=
Table = 43
PostUp = ip rule add from 192.168.1.91 table 43; iptables -w -A FORWARD -i %i -j ACCEPT; iptables -w -A FORWARD -o %i -j ACCEPT; iptables -w -t nat -A POSTROUTING -o ens160 -j MASQUERADE; iptables -t nat -A POSTROUTING -o %i -j MASQUERADE
@vindarel
vindarel / Common Lisp VS Racket - testimonies.md
Last active March 20, 2025 08:45
Common Lisp VS Racket. Feedback from (common) lispers.

Developer experience, libraries, performance… (2021/11)

I'll preface this with three things. 1. I prefer schemes over Common Lisps, and I prefer Racket of the Schemes. 2. There is more to it than the points I raise here. 3. I assume you have no previous experience with Lisp, and don't have a preference for Schemes over Common Lisp. With all that out of the way... I would say Common Lisp/SBCL. Let me explain

  1. SBCL Is by far the most common of the CL implementations in 2021. It will be the easiest to find help for, easiest to find videos about, and many major open source CL projects are written using SBCL
  2. Download a binary directly from the website http://www.sbcl.org/platform-table.html (even for M1 macs) to get up and running (easy to get started)
  3. Great video for setting up Emacs + Slime + Quick Lisp https://www.youtube.com/watch?v=VnWVu8VVDbI

Now as to why Common Lisp over Scheme

@jbaranski
jbaranski / SelfHostOpenStreetMapDocker.md
Created August 1, 2020 14:52
How to self host an Open Street Map server (using Docker)

Here are the steps needed to run a self hosted Open Street Map server (using Docker):

  1. Download desired pbf files (like south-carolina-latest.osm.pbf) from https://download.geofabrik.de or just use the following empty planet below:

    
      <?xml version='1.0' encoding='UTF-8'?>
      <osm version="0.6" generator="osmconvert 0.8.8" timestamp="2019-10-23T20:18:02Z">
        <bounds minlat="42.4276" minlon="1.412368" maxlat="42.65717" maxlon="1.787481"/>
      </osm>
    
@PeterCorless
PeterCorless / newstack-01-file-descriptors.c
Last active January 6, 2024 16:40
newstack-io_uring-ebpf-examples
ssize_t read(int fd, void *buf, size_t count);
ssize_t write(int fd, const void *buf, size_t count);