Skip to content

Instantly share code, notes, and snippets.

#![no_std]
#![no_main]
// pick a panicking behavior
extern crate panic_halt; // you can put a breakpoint on `rust_begin_unwind` to catch panics
// extern crate panic_abort; // requires nightly
// extern crate panic_itm; // logs messages over ITM; requires ITM support
// extern crate panic_semihosting; // logs messages to the host stderr; requires a debugger
{-
Welcome to Spacchetti local packages!
Below are instructions for how to edit this file for most use
cases, so that you don't need to know Dhall to use it.
## Warning: Don't Move This Top-Level Comment!
Due to how `dhall format` currently works, this comment's
instructions cannot appear near corresponding sections below
//A generic container class that ships the type class along with it.
//Used to defined functors of types
type Generic<'T, 'TypeClass when 'TypeClass : (new : unit -> 'TypeClass)> = interface end
//Definition of a monad. Like the functor class, this can be created with new to get the bind/return methods for that
//Monad type
type [<AbstractClass>] MonadClass<'MonadClass when 'MonadClass :> MonadClass<'MonadClass>
and 'MonadClass : (new: unit -> 'MonadClass)>() =
abstract Return<'R> : ('R) -> Generic<'R,'MonadClass>
@btrepp
btrepp / gist:f7560c2e8e2e746767000ff406caa357
Created November 29, 2016 01:39
Octopus deploy behind highlighting
// ==UserScript==
// @name Octopus Highlighting
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://octopus.sdev.psn.corp.riotinto.org/*
// @grant none
// ==/UserScript==
module Free
type Generic<'T, 'TypeClass when 'TypeClass : (new : unit -> 'TypeClass)> = interface end
type [<AbstractClass>] FunctorClass<'FunctorClass when 'FunctorClass :> FunctorClass<'FunctorClass>
and 'FunctorClass : (new : unit -> 'FunctorClass)>() =
abstract FMap<'T, 'R> : ('T -> 'R) -> Generic<'T, 'FunctorClass> -> Generic<'R, 'FunctorClass>
type Free<'a,'f when
'f :> FunctorClass<'f>
#Obviously change this to a different folder if you want
mkdir ~/rpi && cd ~/rpi
LIBSDLVERSION=SDL2-2.0.4
#build deps
sudo apt-get install build-essential g++-arm-linux-gnueabihf cmake
curl https://www.libsdl.org/release/$LIBSDLVERSION.tar.gz | tar xvf
git clone --recursive https://github.com/SDLash3D/xash3d.git
git clone https://github.com/raspberrypi/tools.git --depth=1
@btrepp
btrepp / Makefile
Last active December 1, 2021 04:02
Simple makefile that does javascript fingerprinting so cache times can be configured forever. Requires xidel, grep, md5sum and sed
#This make file will build a fingerprinted version of the application into the OUTDIR variable.
#It checks html files for src="stuff.js" references, and replaces them with fingerpints
#The finger printed file keeps the same directory structure in OUTDIR.
#You can debug your app locally by just loading the files directly. Then run make to get
#The cacheable version in OUTDIR
#Only files referenced in the html are copied into OUTDIR.
#Variables
GNU Make 4.0
Built for i686-pc-cygwin
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
Reading makefile 'includes.mk' (search path) (no ~ expansion)...
Updating makefiles....
INFO global: Vagrant version: 1.6.2
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_DETECTED_OS="CYGWIN_NT-6.1-WOW64"
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.6.2\\bin\\vagrant"
INFO global: VAGRANT_HOME="C:\\ProgramData\\Vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: Vagrant version: 1.6.2
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_DETECTED_OS="CYGWIN_NT-6.1-WOW64"
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.6.2\\bin\\vagrant"
INFO global: VAGRANT_HOME="C:\\ProgramData\\Vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"