Skip to content

Instantly share code, notes, and snippets.

View hasufell's full-sized avatar
👀
Staring

Julian Ospald hasufell

👀
Staring
View GitHub Profile
@ion1
ion1 / install-ghc.md
Last active December 13, 2017 21:01
Installing GHC under the home directory

Installing GHC under the home directory

  1. Install stack.
  2. Run stack setup as a normal user. This will install GHC for you (under ~/.stack).
  3. Run stack ghci to start ghci. Please see the rest of the page linked above on how to use stack to create and build projects.
@geoff-nixon
geoff-nixon / realpath.c
Last active April 18, 2019 03:47
Portable realpath(1) / readlink -f, written is portable POSIX C.
// So, this used to be a really terrible shell script I wrote years ago.
// Its was buggy in all kinds of corner cases, If you really need it, check
// out the revision history. Otherwise, if you have a functioning C compiler,
// you *really* should be using the system's realpath(3) function to do this.
// Here's a bare-bones version. To compile, just: `cc realpath.c -o realpath`
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
{-# LANGUAGE NamedFieldPuns #-}
import XMonad
import XMonad.Config.Desktop
import qualified Data.Map as Map
main :: IO ()
main =
xmonad $ desktopConfig {
terminal = "konsole",
@jonathanknowles
jonathanknowles / init.vim
Created August 26, 2020 09:43
Neovim Configuration
" auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.config/nvim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'neomake/neomake'
@olivierlemoal
olivierlemoal / event_listener.py
Last active February 17, 2021 19:48
i3 script to toggle between last windows
Moved to https://github.com/olivierlemoal/i3-swap-focus
@jabberabbe
jabberabbe / coso.hs
Created October 4, 2021 20:15
tito fighting against the Haskell lexer
module Coso where
testOk1 = [1, 2, 3, 4]
testOk2 =
[ 1
, 2
, 3
]
@rosswd
rosswd / admin.md
Last active October 29, 2021 17:35
Vim cheatsheets

Administrative Commands

Runtime Commands

Path to runtime executable

:echo $VIMRUNTIME

Example Output

/usr/local/share/vim/vim74

@angerman
angerman / Thoughts.md
Created July 11, 2020 04:09
Thoughts on GitLab, Phabricator, ...

A central piece of modern collaborative software development is done using source control tools. One of the most prominent being git. While this is by no means the only one, it is probably the most commonly used one with a cottage industry of tooling around it.

While git is conceptually decentralised, it is mostly used though a central server. Today this central server is often GitHub, or to some degree GitLab, and even a lesser some other hosted options. This provides value in that it's easily accessable from a browser (the ubiquitous way to access information today), and provides discovery facilities.

However, one can argue that the most critical part of collaborative software development is

@simonmichael
simonmichael / SM's Haskell Survival Guide.md
Last active March 5, 2022 03:26
SM's Haskell Survival Guide (draft)

SM's Haskell Survival Guide

Somewhat-repeatable recipes for getting a reliable haskell build toolchain installed as of 2022Q1. You might need to make adjustments, eg on Windows, but hopefully not too many.

Set up with ghcup

Current most popular method. Best way to get native arm tools on mac m1. You can use it to install the compiler ghc, build tools cabal and/or stack, and IDE/editor language server hls (under $HOME/.ghcup). Actively maintained.

  • install latest ghcup (manages haskell core tools)
@nh2
nh2 / SocketUtils.hs
Created July 13, 2019 20:18
Check whether a port is open in Haskell
module SocketUtils
( isPortOpen
, simpleSockAddr
) where
import Data.Word (Word8)
import Foreign.C.Error (Errno(..), eCONNREFUSED)
import GHC.IO.Exception (IOException(..))
import Network.Socket (PortNumber, socket, connect, close', Family(AF_INET), SocketType(Stream), SockAddr(SockAddrInet), tupleToHostAddress)
import UnliftIO.Exception (try, bracket, throwIO)