Skip to content

Instantly share code, notes, and snippets.

View chreekat's full-sized avatar

Bryan Richter chreekat

View GitHub Profile
@chreekat
chreekat / keybase.md
Created February 26, 2018 16:40
more keybase proof D:

Keybase proof

I hereby claim:

  • I am chreekat on github.
  • I am chreekat (https://keybase.io/chreekat) on keybase.
  • I have a public key ASA0oicw7-38n2VbjiH3SGa8_gZGAo8g8EIvHOCYGxELrAo

To claim this, I am signing this object:

Context: I want to repl our app from within 'stack ghci'. I've "backported" DevelMain.hs to work with our hand-updated 1.0⟶1.2 scaffolding: see chreekat/ghci-runner and dev/Runner.hs. It ain't workin so hot just yet. There are three main problems, only one of which I'm going to focus on here[1].

Problem: Adding a new Message :reloads as expected, but does not behave as expected.

  1. I start up my runner mentioned above.
  2. I add a reference to a new Message (_{MsgFoo}) in a template.
  3. I touch the relevant .hs file and :reload. Type error, as expected: No such value "MsgFoo"!
  4. I add a new entry in messages/en.msg, touch Foundation.hs and :reload again. Compile success.
  5. I rerun the site (running main from dev/Runner.hs in the ghci prompt) and load the page that uses the new Message. Surprisingly, it displays the next Message — that is, the value that is on the next line in
@chreekat
chreekat / keybase.md
Created June 30, 2015 22:24
keybase.md

Keybase proof

I hereby claim:

  • I am chreekat on github.
  • I am chreekat (https://keybase.io/chreekat) on keybase.
  • I have a public key whose fingerprint is 33C3 A599 DB85 EA9B 8BAA 1866 B202 2640 2006 8BFB

To claim this, I am signing this object:

" Nested declarations
" ------------------
" This takes something like "let x a = ..." and gives the following syntax
" highlights: x : hsNestedName, a : hsNestedArg.
"
" NOTE: This is very fragile and took a couple days to figure out!
"
" Cribbing off of the example given in nextgroup documentation, here is how
" it works. The example is a two-step, going from Foo to Bar to Foo, But
" what I want a right-recursive nesting of Args (Bars) following the
var linkbot = ...;
var LinkbotWheels = React.createClass({
// Update the component's state on every Linkbot event
componentWillMount: function() {
var me = this;
linkbot.register({
wheel: {
3: {
callback: function(wheelEv) {
@chreekat
chreekat / gist:f872747b77bd27767ece
Created January 1, 2015 14:41
Round robin throttle
# roundRobinThrottle :: Int -> [EventStream] -> EventStream
roundRobinThrottle = (rate, streams) ->
# Merge the input streams into a single, keyed stream
theStream = Bacon.mergeAll(streams.map((s, idx) ->
s.map((val) -> {
type: 'value'
index: idx
value: val
})
))
@chreekat
chreekat / gist:fe7df8a3ee22ba897e43
Last active August 29, 2015 14:04
Steps to make Remmina talk to Mac 10.9ish
# Get build tool
sudo aptitude install apt-src
# Download source package and install build dependencies
cd a/convenient/directory
apt-src install remmina
# Patch the codez
cd remmina-1.0.0/remmina-plugins/vnc
vim vnc_plugin.c
# Add the line *#define LIBVNCSERVER_WITH_CLIENT_TLS 1* next to the
Running Steam on ubuntu 14.04 64-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1405474565_client)
Installing breakpad exception handler for appid(steam)/version(1405474565_client)
Gtk-Message: Failed to load module "overlay-scrollbar"
Gtk-Message: Failed to load module "unity-gtk-module"
Installing breakpad exception handler for appid(steam)/version(1405474565_client)
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number
@chreekat
chreekat / appdata.sh
Last active August 29, 2015 14:03
Set APPDATA (needed for logging in via ssh)
_sid=$(grep "^$USER:" /etc/passwd | sed -e 's/[^:]*:[^:]*:[^:]*:[^:]*:[^:]*,\(S-1-5-[^:]*\):.*/\1/')
_prof=$(cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows\ NT/CurrentVersion/ProfileList/${_sid}/ProfileImagePath)
export APPDATA="${_prof}\\AppData\\Roaming"
unset _sid
unset _prof