Skip to content

Instantly share code, notes, and snippets.

View amonks's full-sized avatar
🐋
🐟🐠🐡

Andrew Monks amonks

🐋
🐟🐠🐡
View GitHub Profile
package main
import "C"
import (
"fmt"
"log"
"os"
"github.com/gdamore/tcell/v2"
// Add something here to handle a new type of plex event.
const event_handlers = {
"media.resume": silent,
"media.pause": silent,
"media.scrobble": silent,
"media.play": verb_handler("started playing"),
"media.stop": silent,
};
// silent handles a plex event by posting no message to rocket chat.
/**
* ## flatten
*
* Flatten an array of integers
*
* This is mighty readable, but it won't perform well in a tight
* loop or with a huge structure.
*
* If that's a problem, we could switch to an iterative process,
* and/or build the output array via mutation. See below.
@amonks
amonks / actor—object.schema
Last active August 21, 2018 18:18
actor—object system with permissions in two graphql interfaces
##############################################################
# #
# GRAPHQL SCHEMA EXAMPLE #
# actor-object system with permissions #
# #
##############################################################
# #
# Andrew Monks #
# 05/15/2017 #
# #

Install arch on a Lenovo Yoga 11e Chromebook

The Thinkpad Yoga 11e isn't the most popular chromebook, but you can readily pick one up for less than 200$, and it's physically built like a tank. You could throw it at a man, pick it back up, and go on typing.

This chromebook is a member of the categories "braswell" and "ULTIMA".

I'll describe the process I followed to get Arch running on it. The firmware steps should be the same if you'd like to install Gallium, an excellent chromebook-optimized distro forked from Xubuntu.

Firmware

how your shell picks which program to run

I often use a program called git in my terminal.

When I type git, my shell runs the program located at /usr/local/bin/git.

I found that out just now by running the command which git:

[I] ⋊> ~ which git
From s.suresh@adityamusicindia.com Sun Jan 22 15:08:05 2017
Date: Mon, 23 Jan 2017 00:07:43 +0300
From: information <s.suresh@adityamusicindia.com>
Subject: {SPAM 10.1} i would lose business and contracts,i'm not even sure if my contract with my employer has a morality clause,"she told CNNMoney on Friday"it could be very damaging"
Hello Mr i am your nightmare
We are attacking your website now and we have taking it down for around
4 hours now.
From hana@melodylogistics.com Tue Jan 24 14:35:31 2017
Date: Tue, 24 Jan 2017 23:34:34 +0300
From: Next Msg To Your Wife! i Swear! or You Pay! <hana@melodylogistics.com>
Subject: {SPAM 08.6} is Your Husband Cheating?
i now have your information.i have also used your user profile to find your
Facebook page,Using this i can now message all of your friends and family
members,
If you would like to prevent me from sharing this dirt info with all of your
@amonks
amonks / hyper.lua
Created January 13, 2017 07:34
hammerspoon hyper key: capslock to escape _and_ cmd+ctrl+alt+shift
print([[
HYPER
## install
Use karabiner-elements to bind capslock to F18
install hammerspoon
#! /usr/bin/env node
// static-server.js
const express = require('express')
const server = express()
// serve whatever directory you run the command from
const dir = process.cwd()
server.use(express.static(dir))