Skip to content

Instantly share code, notes, and snippets.

View izackp's full-sized avatar

Isaac Paul izackp

View GitHub Profile
@phortuin
phortuin / signing-git-commits.md
Last active July 15, 2024 08:53
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@RT2Code
RT2Code / main.cpp
Last active February 18, 2023 09:24
SDL2 Modal Loop Callback
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
#include <Windows.h>
typedef void (*ModalLoopCallback)(void*);
typedef void (*ModalLoopResizeCallback)(SDL_Window*, int, int, void*);
ModalLoopCallback g_modal_loop_callback = NULL;
void* g_modal_loop_userdata = NULL;
ModalLoopResizeCallback g_modal_loop_resize_callback = NULL;
@FreddieOliveira
FreddieOliveira / docker.md
Last active July 25, 2024 00:50
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@haxscramper
haxscramper / languages-and-vms.md
Last active July 2, 2024 03:38
languages-and-vms
@codelynx
codelynx / UnsafePointer Converter.swift
Created September 13, 2020 14:57
[swift] Unsafe Pointer conversion
//
// Swift UnsafePointer converter
// Kaz Yoshikawa
//
// These code demonstrates how to convert swift pointers to the other forms of pointers.
//
// Source:
// Swift の Array やら ArraySlice やらポインタの変換まとめ
// https://qiita.com/Satachito/items/4c39c9b06304e4d86660
//
##[
Fixed point arithmetic
A fixed point number is an alternative representation for a real number.
IEEE floats, `f32` and `f64`, being the standard format in processors with
Floating Point Units (FPU). You should consider using fixed numbers on
systems where there's no FPU and performance is critical as fixed point
arithmetic is faster than software emulated IEEE float arithmetic. Do note
that fixed point numbers tend to be more prone to overflows as they operate
in ranges much smaller than floats.
extension Collection {
public subscript(inplace_slice bounds: Range<Index>) -> Slice<Self> {
get { fatalError() }
_modify {
var slice = Slice(base: self, bounds: bounds)
yield &slice
}
}
}

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active July 22, 2024 20:45
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active July 23, 2024 19:20
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be