Skip to content

Instantly share code, notes, and snippets.

View filipeamoreira's full-sized avatar

Filipe A Moreira filipeamoreira

View GitHub Profile
(ns repl-sessions.demo-2021-07
(:require [lambdaisland.witchcraft :as wc]
[lambdaisland.witchcraft.cursor :as c]
[lambdaisland.witchcraft.events :as e]
[lambdaisland.witchcraft.worlds :as worlds]))
;; First start the server, if you want a clean slate you can create
;; a "superflat" world, otherwise you'll get a more typically generated world.
(wc/start! {;;:server-port 4567
;;:config-dir "/tmp/config"
@mikroskeem
mikroskeem / gccemacs_osx.md
Last active May 12, 2024 15:07
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

@rylev
rylev / rust-in-large-organizations-notes.md
Last active February 2, 2023 10:08
Rust in Large Organizations Notes

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support
#include <algorithm>
#include <array>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
static const size_t STACK_SIZE = 16777216;
static const size_t DEFAULT_THREADS = 4;
struct Runtime;
@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@ericnormand
ericnormand / 00_script.clj
Last active May 18, 2024 08:30
Boilerplate for running Clojure as a shebang script
#!/bin/sh
#_(
#_DEPS is same format as deps.edn. Multiline is okay.
DEPS='
{:deps {clj-time {:mvn/version "0.14.2"}}}
'
#_You can put other options here
OPTS='
@nilayp
nilayp / git-backup-to-Backblaze-B2.sh
Last active June 3, 2024 02:06 — forked from philippb/git-backup-to-AWS-S3.sh
Complete git repository backup script to Backblaze B2
#!/bin/bash
# Script to backup git repo to Backblaze B2
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
# Ensure you have authorized the B2 command line tool with the correct account AND added your SSH
# public key to your github account, if you need to backup private repositories.
# To restore this repo in the future, download it from B2, extract it and then use this command:
# cd old-repository.git
@ctsrc
ctsrc / build.rs
Last active April 6, 2018 14:26
Single-binary website in Rust
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::Path;
// https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-code-generation
fn static_assets (mut f_dest: File, const_name: &str, root_dir: &Path, relpath_asset: &str)
{
f_dest.write_all(b"static ").unwrap();
@lizrice
lizrice / Vagrantfile
Last active February 3, 2023 02:21
Vagrant file for setting up a single-node Kubernetes cluster that I can access from my desktop. Read more: https://medium.com/@lizrice/kubernetes-in-vagrant-with-kubeadm-21979ded6c63
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This script to install Kubernetes will get executed after we have provisioned the box
$script = <<-SCRIPT
# Install kubernetes
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)