Skip to content

Instantly share code, notes, and snippets.

View colinator's full-sized avatar

Colin Prepscius colinator

View GitHub Profile
@colinator
colinator / gist:ff50b0aebe241cec4c1cc68bcdf64c3a
Last active August 17, 2023 13:06
Install bazel on raspberry pi 4 64-bit
# Install Bazel on Raspberry pi 4, with 64-bit Raspbian
$ uname -a
Linux pi41 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
(This is mostly taken from https://www.cryptiot.de/programming/build-bazel-on-raspberry-pi/)
1. sudo raspi-config # Advanced Options -> Expand Filesystem
2. sudo nano /etc/dphys-swapfile # Set CONF_SWAPSIZE to 1024
3. sudo apt update
@colinator
colinator / LazyOptional.swift
Last active April 20, 2017 17:06
LazyOptional variables can be nilled after the fact. Fun with operators! Having a spanish keyboard helps...
/// ¡Solo para el español!
/// Una clase que permite variables opcionales destructibles perezosas.
/// Mantiene el código de construcción cerca de la declaración variable
/// como perezoso, pero puede ser anidado a voluntad.
///
/// Para los gringos:
/// ¿ = option shift ?
/// ¡ = option 1
///
/// ejemplo:
@colinator
colinator / diffDetect.swift
Last active July 15, 2016 15:23
Reactive Cocoa custom signal: diffDetect
// Example of writing a custom signal:
// Starts false, sends true when the signal departs from
// the initial value. Thereafter sends nothing, until the
// signal gets back to initial value, whereupon sends false.
import ReactiveCocoa
extension SignalType where Value: Equatable {
func diffDetect(i: Value) -> Signal<Bool, Error> {