Skip to content

Instantly share code, notes, and snippets.

get :: Int -> Array# a %1-> (# Ur a, Array# a #)
get (GHC.I# i) = Unsafe.toLinear go
where
go :: Array# a -> (# Ur a, Array# a #)
go (Array# arr) =
case GHC.runRW# (GHC.readArray# arr i) of
(# _, ret #) -> (# Ur ret, Array# arr #)
{-# NOINLINE get #-} -- prevents the runRW# effect from being reordered
---------
{-# LANGUAGE TypeApplications #-}
module TidyImportsPlugin (plugin) where
import Data.Function ((&))
import Data.Generics (Data, cast, gmapQr)
import GHC.Hs
import GhcPlugins
plugin :: Plugin
#!/usr/bine/env bash
# Save this script as $PASSWORD_STORE_EXTENSIONS_DIR/rotate.bash to use.
set -o errexit
set -o nounset
set -o pipefail
cd "$PREFIX"
diff --git a/Makefile b/Makefile
index ea517acfb..105e4d884 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,7 @@ debpkg: man/pandoc.1
-v `pwd`/linux/artifacts:/artifacts \
-e REVISION=$(REVISION) \
-w /mnt \
- utdemir/ghc-musl:v8-libgmp-ghc8101 bash \
+ utdemir/ghc-musl:v10-libgmp-ghc8101 bash \

Keybase proof

I hereby claim:

  • I am utdemir on github.
  • I am utdemir (https://keybase.io/utdemir) on keybase.
  • I have a public key whose fingerprint is 76CC C3C7 A739 8C13 21F5 438B F3F8 629C 3E0B F60B

To claim this, I am signing this object:

#!/usr/bin/env sh
STRETCH_DURATION_SECONDS=20
STRETCH_INTERVAL_MINUTES=10
REST_RECURRENCE=6
REST_DURATION_MINUTES=10
if ! command -v yad >/dev/null 2>&1; then
echo "This script requires a 'yad' executable on PATH. Exiting." 2>&1
fzf-history-uniq() {
selected=$(
history 0 \
| awk '{
match($0, /^ *([0-9]+) *(.*)$/, r);
num=r[1]; cmd=r[2];
if(s[cmd]=="") { print cmd; s[cmd]=1; } }' \
| fzf --tac )
BUFFER="$selected"
zle end-of-line
extern crate bindgen;
use std::env;
use std::path::PathBuf;
// Fix for: the name `IPPORT_RESERVED` is defined multiple times
// Issue: https://github.com/rust-lang/rust-bindgen/issues/687
#[derive(Debug)]
struct IgnoreMacros(Vec<String>);
@utdemir
utdemir / pocket-login.bash
Last active December 22, 2019 08:40
Tiny shellscript to authenticate to Pocket (getpocket.com).
#!/usr/bin/env bash
REDIRECT="http://127.0.0.1:7777"
echo "Enter your consumer key."
echo "You can get it from: https://getpocket.com/developer/apps/new"
read -p "> " consumer_key
code=$(
curl -sX POST --data "consumer_key=$consumer_key&redirect_uri=$REDIRECT" \