Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am blakerain on github.
  • I am blakerain (https://keybase.io/blakerain) on keybase.
  • I have a public key ASBTVudJS_NvkszikV0oNDllEy1IS0OhpP9gjT50fDVFRwo

To claim this, I am signing this object:

@BlakeRain
BlakeRain / deploy.yml
Created August 1, 2021 17:22
Workflow to build and deploy the static blakerain.com
name: Build
on:
workflow_dispatch:
repository_dispatch:
types: [deploy-event]
jobs:
deploy:
runs-on: self-hosted
@BlakeRain
BlakeRain / gist:3df35c61963f4dcfd126a6983f8a8712
Created June 9, 2021 16:19
Capture of running stack on M1 without arch option
$ PATH="/opt/homebrew/opt/llvm/bin:$PATH" stack exec -- stack --resolver=ghc-8.10.5 setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.10.5.
ld: unknown option: --version
ld: unknown option: --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/blakerain/.stack/programs/x86_64-osx/ghc-8.10.5/lib/ghc-8.10.5/rts/libHSrts.a(Disassembler.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: fil
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
class ControlPanel(Gtk.Box):
def __init__(self):
super().__init__(orientation=Gtk.Orientation.VERTICAL, spacing=5)
# Place the control panel in the top right
self.set_halign(Gtk.Align.END)
@BlakeRain
BlakeRain / allocating-huge-pages.cc
Created December 11, 2020 11:53
Allocation of hugepages for DMA in Linux
#include <memory>
#include <regex>
#include <cassert>
#include <experimental/filesystem>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@BlakeRain
BlakeRain / example-empty-post.hs
Created February 26, 2018 15:22
Example Empty Post
{-# LANGUAGE TypeFamilies, OverloadedStrings, TemplateHaskell, QuasiQuotes #-}
import qualified Network.Wai.Handler.Warp as Warp
import qualified Network.Wai.Handler.WarpTLS as WarpTLS
import Yesod.Core
data SimpleApp =
SimpleApp
mkYesod "SimpleApp" [parseRoutes|