Skip to content

Instantly share code, notes, and snippets.

View Jomy10's full-sized avatar

Jonas Everaert Jomy10

View GitHub Profile
@eddieh
eddieh / chroot-env-on-mac.org
Created July 28, 2021 19:43
chroot Environments on macOS (draft)

chroot Environments on macOS

This is a draft.

macOS doesn’t have many of the advanced Linux or UNIX features that have come about in the past 20 years. So getting a proper chroot environment up and running takes a little more work.

@mtimbs
mtimbs / tsconfig.json
Last active June 29, 2024 17:03
basic default tsconfig for use in TypeScript projects
{
"compilerOptions": {
// project options
"lib": [
"ESNext",
"dom"
], // specifies which default set of type definitions to use ("DOM", "ES6", etc)
"outDir": "lib", // .js (as well as .d.ts, .js.map, etc.) files will be emitted into this directory.,
"removeComments": true, // Strips all comments from TypeScript files when converting into JavaScript- you rarely read compiled code so this saves space
"target": "ES6", // Target environment. Most modern browsers support ES6, but you may want to set it to newer or older. (defaults to ES3)
@colejhudson
colejhudson / Makefile
Last active November 17, 2023 21:10
A base Makefile for compiling swift targeted for iOS without using XCode
# Adapted from http://vojtastavik.com/2018/10/15/building-ios-app-without-xcode/
SYS_BASE := /usr/local
SYS_LIB := $(SYS_BASE)/lib
SYS_INCLUDE := $(SYS_BASE)/include
ORGANIZATION := # Organization Name
NAME := # App Name
BUNDLE := $(NAME).app
@fnky
fnky / ANSI.md
Last active July 18, 2024 18:21
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@cmer
cmer / config.ru
Last active December 31, 2023 15:34
Gem In a Box basic authentication & authorization rackup file
#
# This is a simple rackup file for geminabox. It allows simple role-based authorization.
#
# roles:
# - developer
# - upload
# - delete
# - admin (can do anything)
#
# For example, a developer who can access the service and upload new gems would have the following roles: `%w(developer upload)
@chriseidhof
chriseidhof / goroutines.swift
Created February 16, 2018 12:36
goroutines.swift
import Foundation
protocol Channel: IteratorProtocol {
func send(_ value: Element?)
}
/// A blocking channel for sending values.
///
/// `send` and `receive` must run in separate separate execution contexts, otherwise you get a deadlock.
final class BlockingChannel<A>: Channel {
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
private var array = [Element]()
public init() { }
@cjonesy
cjonesy / macbook_pro_ubuntu_install.md
Last active July 12, 2024 23:40
Installing Ubuntu on MacBook Pro

Macbook Pro - Ubuntu Install

Requirements

2 USB drives > 2GB

Pre-Install

Create bootable USB drive

  1. Grab the latest Ubuntu Desktop iso image
@notozeki
notozeki / Makefile
Last active March 22, 2023 16:27
An example Ruby extension written in Crystal
CRYSTAL = crystal
UNAME = "$(shell uname -ms)"
LIBRARY_PATH = $(shell brew --prefix crystal-lang)/embedded/lib
LIBS = -levent -lpcl -lpcre -lgc -lpthread
LDFLAGS = -Wl,-undefined,dynamic_lookup
TARGET = crystal_example_ext.bundle
$(TARGET): crystal_example_ext.o
$(CC) -bundle -L$(LIBRARY_PATH) -o $@ $^ $(LIBS) $(LDFLAGS)
@samrat
samrat / sdl2_stbtt.c
Last active September 4, 2023 12:30
Drawing text into a bitmap w/ stb_truetype
#include "SDL.h"
/*
Compilation:
============
gcc -g --std=c99 -o sdl2_stbtt sdl2_stbtt.c `sdl2-config --cflags --libs` -lm
Usage:
======
./sdl2_stbtt /usr/share/fonts/TTF/LiberationMono-Regular.ttf