Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@guest271314
guest271314 / compiling_standalone.md
Last active April 9, 2024 08:48
Compiling a standalone executable using modern JavaScript/TypeScript runtimes

Compiling a standalone executable using modern JavaScript/TypeScript runtimes

We have the same code working using node, deno, and bun.

E.g.,

bun run index.js
@ijpatricio
ijpatricio / Dockerfile
Last active March 19, 2024 02:45
Build ARM Images in GitHub Actions
# more stages...
# When using a Node image, make sure to use the amd64 version, or it will take forever
# GH Actions is running arm64 in a emulator (QEMU). This way, it will use the native amd64 and be much faster.
FROM --platform=linux/amd64 node:19 as static-assets
WORKDIR /app
COPY . .
RUN npm install ; npm run build
# more stages...
@slimsag
slimsag / ramblings.md
Last active December 13, 2023 08:02
Because cross-compiling binaries for Windows is easier than building natively

Because cross-compiling binaries for Windows is easier than building natively

I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.

The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.

The source of truth for the 'open source' C#, C++, Rust, and other Windows SDKs is proprietary

You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.

@myobie
myobie / ci.yml
Last active September 20, 2023 09:26
Don't run GitHub Actions for pull requests that are drafts
on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
@dhoeric
dhoeric / 0_README.md
Last active April 25, 2024 13:24
Google Calendar - Public Holiday Calendars
@dtmilano
dtmilano / colors
Created November 26, 2019 01:31
Shows terminal colors
#! /bin/bash
n=32
arg=setaf
text='Hello World! This is %s %d'
_help()
{
printf 'usage: %s [--help|-H] [--16] [--256] [-t|--tiny] [--background|-b]\n' "$(basename $0)"
exit 0
@sgyyz
sgyyz / uao.md
Last active May 3, 2024 14:15
uao command - unzip your project and import to intellij automatically
  1. import project into idea command
$ curl -L "https://gist.githubusercontent.com/chrisdarroch/7018927/raw/9a6d663fd7a52aa76a943fe8a9bc6091ad06b18d/idea" -o /usr/local/bin/idea
$ chmod +x /usr/local/bin/idea
  1. unzip and open project command
$ curl -L "https://gist.githubusercontent.com/sgyyz/adfa4f05af3d81cf0e17e19cf7044c85/raw/b6b9e871d5a4f5435a09d00b0a52e3db0b90699a/uao.sh" -o /usr/local/bin/uao.sh
$ chmod +x /usr/local/bin/uao.sh
$ ln -sf /usr/local/bin/uao.sh /usr/local/bin/uao
@stibi
stibi / gist:20b0a5d496bdbd5073dde50662fa9b25
Created December 28, 2018 10:45
Open VPN connection, read oauth token from yubikey
#!/usr/bin/expect
set username "mstiborsky\r"
set config "/etc/openvpn/client/zonky.conf"
set vpn_oauth_token [exec ykman oath code -s vpn]
spawn openvpn --config $config --auth-user-pass
expect "Enter Auth Username:"
send $username
expect "Enter Auth Password:"
@stibi
stibi / cmd.md
Last active January 13, 2019 21:08

Find biggest dirs on ...

du -Sh | sort -rh | head -5

Number sequence loop

for i in $(seq 1 $END); do echo $i; done
@kshcherban
kshcherban / ec2-root-resize.sh
Created November 13, 2018 14:28
ec2 root volume resize
#!/bin/bash -e
if [ $# -ne 2 ]; then
echo "Usage: $0 <instance-id> <volume-size-gb> [PARITION_NAME=/dev/xvda2]"
exit 2
fi
INSTANCE="$1"
VOLUME_SIZE="$2"
PARTITION="${3:-/dev/xvda2}"