This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cancelUnit :: | |
Iso (a, ()) (b, ()) a b | |
cancelUnit = | |
iso | |
(\(a, ()) -> a) | |
(\b -> (b, ())) | |
cancelVoid :: | |
Iso (Either a Void) (Either b Void) a b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env cabal | |
{- cabal: | |
build-depends: | |
, base ^>= 4.12 | |
, contravariant ^>= 1.5 | |
-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hardware.deviceTree.overlays = [ | |
{ name = "spi"; dtsFile = "${./dt/spi.dts}"; } | |
{ name = "pps"; | |
dtsText = '' | |
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "raspberrypi"; | |
fragment@0 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set -XRankNTypes | |
:set -XGADTs | |
:set -XTypeFamilies | |
:set -XTypeApplications | |
:set -XBangPatterns | |
:set -XMagicHash | |
:set -XMultiParamTypeClasses | |
:set -XPatternSynonyms | |
:set -XDataKinds | |
:set -XConstraintKinds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ cert ? "", key ? "" }: { | |
server = { config, pkgs, ... }: { | |
services.openssh.enable = true; | |
services.panamax.enable = false; | |
}; | |
hidden = { config, lib, pkgs, ... }: with lib; { | |
options = { | |
owncloudHost = lib.mkOption { | |
default = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ...}: { | |
systemd.services.generate-nix-cache-key = { | |
wantedBy = [ "multi-user.target" ]; | |
serviceConfig.Type = "oneshot"; | |
path = [ pkgs.nix ]; | |
script = '' | |
[[ -f /etc/nix/private-key ]] && exit | |
nix-store --generate-binary-cache-key ${config.networking.hostName}-1 /etc/nix/private-key /etc/nix/public-key | |
''; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/usr/env bash | |
# Originaly from: https://www.reddit.com/r/NixOS/comments/5yxt45/simple_nix_package_search/ | |
nq () { | |
local CACHE="$HOME/.cache/nq-cache" | |
if ! ( [ -e $CACHE ] && [ $(stat -c %Y $CACHE) -gt $(( $(date +%s) - 3600*24*7 )) ] ); then | |
# read gotcha.. can't pipe to read (as usual zsh beats bash) | |
read x MEM_AVAIL_KB UNIT < <(grep MemAvailable: /proc/meminfo) | |
if [[ $UNIT != "kB" || $MEM_AVAIL_KB -lt 1000000 ]]; then | |
# nix-env can easily use up to 1GB during -qa |
OlderNewer