Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Main {
map = [T, U](value: T, mapper: { map: (inp: T) -> U }): { value: U } ->
{ value = mapper.map(value) },
main = (): { value: Int } -> map("foobar", { map = (inp: String): Int -> 10 })
}
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.51-v7+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1333 SMP Mon Aug 10 16:45:19 BST 2020
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Rev 1.2
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x37400000, size 64 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] On node 0 totalpages: 242688
@pentlander
pentlander / gossip.rs
Created April 7, 2017 04:27
Gossip Tokio
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate bytes;
extern crate futures;
extern crate tokio_io;
extern crate tokio_core;
extern crate tokio_timer;
use std::str;
@pentlander
pentlander / tasker_morse.js
Created July 14, 2016 00:57
Vibrate to the contact's initials in morse code with Tasker
var dotLength = 110;
var dashLength = 3 * dotLength;
var pauseBetweenElements = 2 * dotLength;
var pauseBetweenWords = 3 * dotLength;
function nameToVibrations(fullName) {
var initials = getInitials(fullName);
var vibrations = initials.map(wordToMorseCode)
.map(morseCodeToVibrations)
.join(",".concat(pauseBetweenWords).concat(","));
using UnityEngine;
using System.Collections;
public class LaserScript : Projectile {
public GameObject laserStart;
public GameObject laserMiddle;
public GameObject laserEnd;
public float maxLaserDistance;
private GameObject start;