Skip to content

Instantly share code, notes, and snippets.

@Kiwi
Kiwi / ghci.conf
Created Oct 27, 2020 — forked from emilypi/ghci.conf
My modest ghci.conf
View ghci.conf
:set -XRankNTypes
:set -XGADTs
:set -XTypeFamilies
:set -XTypeApplications
:set -XBangPatterns
:set -XMagicHash
:set -XMultiParamTypeClasses
:set -XPatternSynonyms
:set -XDataKinds
:set -XConstraintKinds
View gist:06f2f343cac84be515133579b83b4ecd
; Ender 3 Custom Start G-code
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M104 S160; start warming extruder to 160
G28 ; Home all axes
G29 ; Auto bed-level (BL-Touch)
G92 E0 ; Reset Extruder
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature
@Kiwi
Kiwi / demo.hs
Created Feb 28, 2020
arduino-copilot eeprom demo
View demo.hs
{-# LANGUAGE RebindableSyntax #-}
import Copilot.Arduino.Uno
import qualified Copilot.Arduino.Library.EEPROMex as EEPROM
import qualified Copilot.Arduino.Library.Serial as Serial
import System.Posix.Env
import qualified Prelude
main :: IO ()
main = do
@Kiwi
Kiwi / conf.nix
Created Feb 6, 2020 — forked from sorki/conf.nix
overlays prototype
View conf.nix
hardware.deviceTree.overlays = [
{ name = "spi"; dtsFile = "${./dt/spi.dts}"; }
{ name = "pps";
dtsText = ''
/dts-v1/;
/plugin/;
/ {
compatible = "raspberrypi";
fragment@0 {
@Kiwi
Kiwi / Cosort.hs
Created Apr 29, 2019 — forked from chshersh/Cosort.hs
Contravariant version of Divide and Conquer algorithm
View Cosort.hs
#! /usr/bin/env cabal
{- cabal:
build-depends:
, base ^>= 4.12
, contravariant ^>= 1.5
-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
View c.hs
cancelUnit ::
Iso (a, ()) (b, ()) a b
cancelUnit =
iso
(\(a, ()) -> a)
(\b -> (b, ()))
cancelVoid ::
Iso (Either a Void) (Either b Void) a b
View gist:471054
#!/usr/bin/python2.4
#
# Copyright 2007 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
You can’t perform that action at this time.