Skip to content

Instantly share code, notes, and snippets.

@bodil
bodil / main.ts
Created November 8, 2022 22:10
Add migration aliases to a Pleroma account
import generator, { OAuth } from "megalodon";
import PleromaAPI from "megalodon/lib/src/pleroma/api_client";
import { DEFAULT_UA } from "megalodon/lib/src/default";
import * as readline from "readline-sync";
async function main() {
const baseUrl = readline.question('URL of Pleroma instance (ex. "https://lol.camp"): ');
const registerClient = generator("pleroma", baseUrl);
const appData = await registerClient.registerApp("User Alias Editor", {});

How to put a GNU/Linux installation on your Chromebook

DISCLAIMER: This could all quite plausibly brick your Chromebook, and I take no responsibility for any damage you might inflict on it or yourself. Follow along at your own risk.

Most Chromebooks can run some flavour of GNU/Linux using the Chrubuntu method, running off the kernel that comes with ChromeOS. I found, however, that the ChromeOS kernel didn’t play well with recent X.org versions, and would refuse to recover from suspend, and not deal very well at all with having an external screen attached to it.

I also wanted to replace ChromeOS entirely with Arch on my Chromebook, because only 16 gigabytes of eMMC isn’t very convenient for dual booting. To accomplish this, I needed an external installation medium.

First of all, you’ll need to get your Chromebook into developer mode if you haven’t already. This is model specific, although for most recent models holding the Escape and Reload keys while booting should do the trick. If not, ask Google.

@bodil
bodil / bool.rs
Last active February 28, 2021 03:50
Simple type level natural numbers in Rust
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct True;
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct False;
pub trait Bool {
fn new() -> Self;
}
impl Bool for True {
@bodil
bodil / init.ts
Created August 12, 2019 17:34
Snapshot of my vscode-use-package setup
import * as vscode from "vscode";
import { initUsePackage, usePackage, configSet } from "vscode-use-package";
import * as nav from "./nav";
import * as js from "./js";
import * as rust from "./rust";
export function init(context: vscode.ExtensionContext) {
console.log(`HELLO FROM INIT SCRIPT`);
@bodil
bodil / tween.ts
Created May 27, 2014 16:29
Tween.js + Bacon.js === <3
///<reference path="dts/tween.js.d.ts" />
///<amd-dependency path="tween" />
import b = require("./bacon");
import graph = require("./graph");
import ev = require("./events");
module TweenEffects {
var Tween = require("tween.js").Tween;
@bodil
bodil / hindley-milner.clj
Last active August 12, 2019 18:08
Port of http://dysphoria.net/code/hindley-milner/HindleyMilner.scala to 100% pure Clojure code, complete with state monad hell. Originally based on Luca Cardelli's paper "Basic Polymorphic Typechecking" http://lucacardelli.name/Papers/BasicTypechecking.A4.pdf
;;; Clojure port of http://dysphoria.net/code/hindley-milner/HindleyMilner.scala
(ns hindley-milner
(:require [clojure.string :as str]))
(declare occurs-in? occurs-in-type?)
(defn map-state
"Evaluate a list of state monad values in sequence, producing
a list of the results of each evaluation."
@bodil
bodil / electric_wadleroo.rs
Last active January 28, 2019 22:52
Who needs higher kinded types anyway
trait Higher<A, B> {
type Target;
}
trait Higher3<A, B, C> {
type Target2;
type Target3;
}
impl<A, B> Higher<A, B> for Option<A> {
@bodil
bodil / fix-my-stupid-folio.service
Created November 24, 2016 15:05
Hacks for Linux kernel glitches on the HP Elitebook Folio G1
[Unit]
Description=HP Elitebook Folio G1 fixes
[Service]
ExecStart=/sbin/fix-my-stupid-folio
[Install]
WantedBy=basic.target

Keybase proof

I hereby claim:

  • I am bodil on github.
  • I am bodil (https://keybase.io/bodil) on keybase.
  • I have a public key ASAhOfE9MM6Kez7pDhD-sZvig7dr5jTYIwXBtuMHS32ZtQo

To claim this, I am signing this object:

@bodil
bodil / package.json
Last active September 21, 2017 13:18
Who needs Pulp anyway?
{
"name": "lol",
"version": "1.0.0",
"main": "index.js",
"config": {
"main": "Main",
"testMain": "Test.Main"
},
"scripts": {
"compile": "psc -c -f 'src/**/*.js' -f 'bower_components/purescript-*/src/**/*.js' 'src/**/*.purs' 'bower_components/purescript-*/src/**/*.purs'",