Skip to content

Instantly share code, notes, and snippets.

:octocat:
🤔 💭

David Johnson dmjio

Block or report user

Report or block dmjio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ff.csv
We can't make this file beautiful and searchable because it's too large.
View CEnumToHsc2HsEnum.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
module Main where
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
import Data.Char
import Data.List
View install-nixos.sh
parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- mkpart primary 512MiB -8GiB
parted /dev/nvme0n1 -- mkpart primary linux-swap -8GiB 100%
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB
parted /dev/nvme0n1 -- set 3 boot on
cryptsetup luksFormat /dev/nvme0n1p1
cryptsetup luksOpen /dev/nvme0n1p1 cryptroot
mkfs.ext4 -L nixos /dev/mapper/cryptroot
mkswap -L swap /dev/nvme0n1p2
mkfs.fat -F 32 -n boot /dev/nvme0n1p3
View install-nixos.sh
# parted /dev/nvme0n1 -- mklabel gpt
# parted /dev/nvme0n1 -- mkpart primary 512MiB -8GiB
# parted /dev/nvme0n1 -- mkpart primary linux-swap -8GiB 100%
# parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB
# parted /dev/nvme0n1 -- set 3 boot on
# mkfs.ext4 -L nixos /dev/nvme0n1p1
# mkswap -L swap /dev/nvme0n1p2
# mkfs.fat -F 32 -n boot /dev/nvme0n1p3
# mount /dev/disk/by-label/nixos /mnt
View Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>app</string>
<key>CFBundleIdentifier</key>
<string>app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
View bens.txt
/nix/store/b1wrwkm0bd70rwbqcxipdbb5mnx1hmnc-qemu-host-cpu-only-for-vm-tests-3.1.0/bin/qemu-system-x86_64
-enable-kvm
-cpu kvm64
-name botlab
-m 4000
-smp 2
-device virtio-rng-pci
-net nic,netdev=user.0,model=virtio
-netdev user,id=user.0
-virtfs local,path=/nix/store,security_model=none,mount_tag=store
View Foo.hs
{-# LANGUAGE ViewPatterns #-}
main = print $ foo ["hey"] ["there"]
foo :: [a] -> [b] -> [(a,b)]
foo (zip -> xs) = xs
View hlint-pass-hlint.hs
Found:
t = \ a -> (findIndex ((==) a)) ==> (elemIndex a)
Perhaps:
t a = (findIndex ((==) a)) ==> (elemIndex a)
./data/HLint_QuickCheck.hs:119:20: Suggestion: Redundant bracket
Found:
(findIndex ((==) a)) ==> (elemIndex a)
Perhaps:
findIndex ((==) a) ==> (elemIndex a)
You can’t perform that action at this time.