Skip to content

Instantly share code, notes, and snippets.

View Dessix's full-sized avatar
🏳️‍⚧️

Zoey Dessix

🏳️‍⚧️
  • Microsoft; Theseus Institute
  • Redmond, WA, U.S.
View GitHub Profile
@ivan
ivan / cargo.sh
Last active July 3, 2024 06:49
cargo wrapper for NixOS and Rust nightly: mold, target-cpu, -Z share-generics
#!/usr/bin/env bash
# NixOS-only cargo wrapper that:
# - always uses mold for linking.
# - sets `-C target-cpu=haswell` to avoid generating code for pre-2013 CPUs.
# - sets `-C link-arg=-Wl,--compress-debug-sections=zlib-gabi` to compress debug sections.
# - sets LIBCLANG_PATH for projects that need clang.
# - sets `-Z share-generics` to reduce output binary sizes by ~2MB.
# - turns on cargo's sparse-registry feature.
# - increases niceness slightly with `nice -n 2` .
@csobankesmarki
csobankesmarki / convert private key
Last active July 18, 2024 17:12
Convert OpenSSH ED25519 to OpenSSL ED25519
(printf \\x30\\x2e\\x02\\x01\\x00\\x30\\x05\\x06\\x03\\x2b\\x65\\x70\\x04\\x22\\x04\\x20;egrep -v "^-" | tr -d '\n' | base64 -d | dd bs=161 skip=1 2>/dev/null | dd bs=32 count=1 2>/dev/null) | openssl pkey -inform der -outform pem
@lashtear
lashtear / Delaunay.hs
Created August 2, 2017 22:36
My old 2D Delaunay/Voronoi tessellation tools
{-# LANGUAGE TupleSections #-}
module Delaunay where
import qualified Data.Function as F
import qualified Data.List as L
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.Set (Set)
import qualified Data.Set as Set
@boj
boj / .spacemacs
Created March 6, 2017 19:00
.spacemacs
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
{-# OPTIONS -Wall #-}
module Creepsay where
-- ^ This file has some random scribblings for Screeps Diplomacy
-- protocol discussion. Most of the things in here are not directly
-- of use, but might help for assembling reference examples, once we
-- figure out how the various layers should work.
--
-- The 62k suffix entries are "base62k" encoding, i.e. using all of
-- the UCS2 space except for the 0xd800-0xdfff region historically
@TiddoLangerak
TiddoLangerak / getCurrentWindowCWD.sh
Last active February 19, 2022 08:07
Script to get the CWD of the current active window, with support for shells running tmux. This can be used to launch new terminals in the same cwd as the current one.
#!/bin/bash
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
# Inspired by https://gist.github.com/viking/5851049 but with support for tmux
CWD=''
# Get window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get PID of process whose window this is
@tonymorris
tonymorris / Lens.cs
Created August 5, 2012 05:43
Lens library for C# (demonstration)
using System;
using System.Collections;
using System.Collections.Generic;
/*
A basic lens library for the purpose of demonstration.
Implements a lens as the costate comonad coalgebra.
This library is not complete.
A more complete lens library would take from
@Acorn-zz
Acorn-zz / GM_XHR.js
Created July 2, 2011 13:32 — forked from monperrus/GM_XHR.js
allows using all Jquery AJAX methods in Greasemonkey
// allows using all Jquery AJAX methods in Greasemonkey
// inspired from http://ryangreenberg.com/archives/2010/03/greasemonkey_jquery.php
// works with JQuery 1.5
// (c) 2011 Martin Monperrus
// (c) 2010 Ryan Greenberg
//
// Usage:
// $.ajax({
// url: '/p/',
// xhr: function(){return new GM_XHR();},