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 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 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]
View capstone-3.0.5_rc3.exheres-0
# Copyright 2017 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2
require setup-py [ import=distutils work=${PNV/_rc/-rc}/bindings/python ]
require github [ user="aquynh" tag="${PV/_rc/-rc}" ]
SUMMARY="Capstone disassembly/disassembler framework"
HOMEPAGE="http://www.capstone-engine.org/ ${HOMEPAGE}"
LICENCES="BSD-3"
@hasufell
hasufell / For.hs
Last active Sep 16, 2017
For loop in haskell
View For.hs
module For where
import Control.Monad
import Data.IORef
for :: IO a -- ^ init
-> (a -> IO Bool) -- ^ cond
-> (a -> IO ()) -- ^ incr
-> (a -> IO ()) -- ^ body
You can’t perform that action at this time.