Skip to content

Instantly share code, notes, and snippets.

View shawnanastasio's full-sized avatar

Shawn Anastasio shawnanastasio

View GitHub Profile
@shawnanastasio
shawnanastasio / keybindings.json
Created July 9, 2022 18:49
vscode keybindings.json
[
{
"key": "ctrl+k",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+j",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
@shawnanastasio
shawnanastasio / settings.json
Last active June 15, 2023 18:06
vscode settings.json
{
"git.ignoreLegacyWarning": true,
"telemetry.telemetryLevel": "off",
"terminal.integrated.commandsToSkipShell": ["-workbench.action.quickOpen"],
"vim.leader": "-",
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "h"],
"commands": ["workbench.action.previousEditor"],
},
@shawnanastasio
shawnanastasio / pubkey
Created February 15, 2021 20:23
GPG Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBGAcsNYBDACiiwBlHhpmVBtN48oXtDVR//5XVNnG2pr26QXtq3i8ibFmbnub
vwn5zRSbJuVrgpEYlkDbxW2YZNRQbALHp+gTWPJjpYeO38jzhswgBU24wKJcHmqZ
O9Dn9tekGSstT65+NeIwCwAc+A50X+vjLwDolCo50gWzrh2UsGHlCcEEkCqFj63t
WjYpFHjc71J/HvLtsuGuIAE1uKlMhMydHNxR0O3XCrJxzGlXoTe83Swux+xiu9RH
vnNcjSaulN5GDvfNXg/PnQiCqc/knv924QeSwuA6itUza7JeOlxsiEybglbkP49S
aHvQKssWxfmu5bdSPfOr0Kpy503BlTKvFBfXZlPxBDTee2hvBiU1kXQ1O9ZIObv2
qUrDPPfhNshE1N42C28p/Kl3VQ1h+411sjBSb82C7mEkrLUkjcCXz1F38q2WyaKZ
FY9ro7MgHqUocM3mg6lmlFLpxGp2MxATATuh4cAsAqtkLbH0ayvB21dwn6PN1aEu
@shawnanastasio
shawnanastasio / gist:0e55762b8c232fe24007847af2021240
Created January 14, 2021 23:45
Building gcc-darwin-arm64 fork natively from clang
$ brew install mpfr gmp libmpc
$ git clone https://github.com/iains/gcc-darwin-arm64
$ mkdir build-gcc && cd build-gcc
$ CC=clang CXX=clang++ ../gcc-darwin-arm64/configure \
--with-gmp=/opt/homebrew/Cellar/gmp/6.2.1 \
--with-mpfr=/opt/homebrew/Cellar/mpfr/4.1.0 \
--with-mpc=/opt/homebrew/Cellar/libmpc/1.2.1 \
--with-native-system-header-dir=/usr/include \
--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
--disable-nls \
@shawnanastasio
shawnanastasio / gensyslinux.py
Created November 17, 2018 10:24
Automatic syslinux.cfg generator for petitboot
#!/usr/bin/env python3
import os
import re
import sys
BOOT_DIR = "/boot/"
ENTRY_NAME_PREFIX = "Gentoo Linux"
APPEND = "crypt_root=UUID=76543706-8215-4e11-bbfb-8acf447d6bb7 root=/dev/mapper/root"
KERNEL_RE = "vmlinux.*[0-9]+\.[0-9]+\.[0-9]+.*"
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
@shawnanastasio
shawnanastasio / makecross.sh
Last active January 25, 2019 20:26
Automatic GCC/Binutils Cross Toolchain script
#!/bin/bash
set -e
# Number of threads to compile with
THREADS=15
# GCC/Binutils download URL
GCC_URL="https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.xz"
BINUTILS_URL="ftp://ftp.gnu.org/gnu/binutils/binutils-2.30.tar.xz"
@shawnanastasio
shawnanastasio / read_lines.c
Last active April 25, 2016 01:03
Read a file line-by-line in C
/**
* Reads a file line-by-line.
* smh
* Created by Shawn Anastasio.
* Licensed to Public Domain.
*/
#include <stdio.h>
#define MAX_FILE_SIZE 1024