Skip to content

Instantly share code, notes, and snippets.

View dbaynard's full-sized avatar

David Baynard dbaynard

  • Fore Stun Ltd
View GitHub Profile
@akostadinov
akostadinov / fonts_find.sh
Created May 19, 2021 21:10
shows fonts containing character
#!/usr/bin/env bash
# example: ./font_find.sh 🎩︎
# credits: David Baynard, https://unix.stackexchange.com/a/393740/14907
param="$1"
char=${param:0:1}
printf '%x' \'"$char" | xargs -I{} fc-list ":charset={}"
# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@cdepillabout
cdepillabout / example.nix
Last active February 7, 2023 03:52
Example of overriding a GHC core Haskell package with Nix
# This file is an example of overriding a GHC core Haskell library (like
# bytestring, containers, text, unix, etc) when building a Haskell package.
let default-nixpkgs =
builtins.fetchTarball {
# nixpkgs haskell-updates branch as of 2019/09/15.
url = "https://github.com/NixOS/nixpkgs/archive/a51b3367ab6acc72630da0bad50ce14fa86996d0.tar.gz";
sha256 = "05d3jxxk5dxzs9b3nan16lhkrjnzf0bjd4xy66az86fsafnrr9rd";
};
in
@Icelandjack
Icelandjack / Constraints.org
Last active April 2, 2024 20:22
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.

-- Example of a dynamically generated FromJSON instance.
--
-- Can be useful when one needs to use a function with a
-- FromJSON constraint, but some detail about the
-- conversion from JSON is not known until runtime.
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
anonymous
anonymous / qtcurve-gtk2.patch
Created February 4, 2015 10:48
qtcurve-gtk2.patch
diff -aur qtcurve-1.8.18/gtk2/style/qtcurve.c qtcurve-1.8.18.patched/gtk2/style/qtcurve.c
--- qtcurve-1.8.18/gtk2/style/qtcurve.c 2014-01-25 21:13:54.000000000 +0100
+++ qtcurve-1.8.18.patched/gtk2/style/qtcurve.c 2015-02-02 18:05:22.348872008 +0100
@@ -372,7 +372,7 @@
} else if (!(qtSettings.app == GTK_APP_JAVA && widget &&
GTK_IS_LABEL(widget))) {
if (state != GTK_STATE_PRELIGHT || opts.crHighlight ||
- strcmp(detail, "checkbutton") != 0) {
+ ( detail != NULL && strcmp(detail, "checkbutton") != 0 )) {
parent_class->draw_flat_box(style, window, state, shadow, area,
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}