Skip to content

Instantly share code, notes, and snippets.

👀
Staring

Julian Ospald hasufell

👀
Staring
Block or report user

Report or block hasufell

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 keybase.md

Keybase proof

I hereby claim:

  • I am hasufell on github.

  • I am maerwald (https://keybase.io/maerwald) on keybase.

  • I have a public key ASD4nyaFvOcwo0fVoRlS-fAsqKt8jRjEYo9hH-heREmstQo

View debounce.ts
/**
* Returns a constant value. This will only
* be computed on the first render.
*/
export function useConst<T>(value: T | (() => T)): T {
const [state] = useState<T>(() =>
typeof value === "function" ? (value as Function)() : value
);
return state;
}
View DirTree.hs
{-# OPTIONS_HADDOCK ignore-exports #-}
module DirTree where
import Control.Applicative
import Control.Exception.Base(IOException)
import Data.Ord (comparing)
import Data.List (sort, sortBy, (\\))
import Data.Time.Clock
import Data.Word
View cabal.project
packages: .
source-repository-package
type: git
location: https://github.com/tel/saltine.git
tag: 8bc2a719806fbdce82c20e0a102255e296e325cf
View test-broken-symlink.sh
View get_download_urls.txt
# fmt-version=1
# tab separated columns
# tool | version | arch | supported-distros | url |
ghc 8.4.3 x86_64 |debian,{6,7,8}|gentoo|archlinux| <url-to-deb-tarball>
ghc 8.4.3 x86_64 |fedora|centos,{7}| <url-to-fedora-tarball>
ghc 8.4.3 i386 |debian,{6,7,8}| <url>
ghc 8.4.4 x86_64 |ubuntu|gentoo|archlinux| <url>
cabal 2.4.0.0 x86_64 |unknown| <url>
View Nix_sucks.md

Nix sucks

Attempting to install NixOS

  1. installing NixOS, it fails to detect the UEFI partition on nixos-install, however installs, because that partition is obviously mounted, but doesn't record it in hardware-configuration.nix. Changing configuration after reboot seems to work, but the new configuration never shows up in the boot menu and is never booted. Silent failure, no error handling, wasted hours of debugging and rebooting.
  2. Trying to mix xfce4 with i3 fails, xfce session is never started. Fixing it requires special configuration and even changing the display manager, because the default has a hack to find sessions, which is broken, so you cannot choose "xfce+i3".
  3. Suspend and hibernate is broken.
  4. Setting up vim becomes a huge exercise in bug-hunting and configuration
    • First, vims default python is 2, breaking a lot of recent plugins. Setting it to 3 becomes a long quest in reading through ML posts and SO questions with odd configurations as answers. There is a wiki page about vim
@hasufell
hasufell / pre-commit.sh
Last active Jun 8, 2018
automate digest generation
View pre-commit.sh
#!/bin/bash
#
# Author: Julian Ospald <hasufell@posteo.de>
# Version: 0.0.1
# Date: 2018-06-08
# Reason: automate digest generation
#
# This pre-commit hook generates digests for all packages
# that have been changed and possibly adds the Manifests to the index.
#
View .gometalinter.json
{
"Enable": ["vet", "golint", "megacheck"],
"Vendor": true,
"Aggregate": true,
"Errors": true,
"Deadline": "600s",
"Linters": {
"vet": {
"Command": "go vet",
"PartitionStrategy": "packages"
View Lens.hs
data Flag = Flag {
_flagName :: String
, _flagDep :: [Int]
}
-- If a flag with name 'fname' already exists in the input list,
-- add 'fdep' to it. Otherwise append a new Flag to the list with 'fdep'
-- being the only item.
addFlag :: [Flag] -> String -> Int -> [Flag]
You can’t perform that action at this time.