#nix #rust
Requires flakes to be enabled. {.is-warning}
There are a few pieces that make up a complete Nix workflow for building Rust crates:
// It is important to declare your variables. | |
(function() { | |
var foo = 'Hello, world!'; | |
print(foo); //=> Hello, world! | |
})(); | |
// Because if you don't, the become global variables. | |
(function() { |
#nix #rust
Requires flakes to be enabled. {.is-warning}
There are a few pieces that make up a complete Nix workflow for building Rust crates:
/* @flow */ | |
// Helper function for matching against an ADT. | |
export function match<A,B>(matcher: A): (match: (matcher: A) => B) => B { | |
return match => match(matcher) | |
} |
# Makefile for transpiling with Babel in a Node app, or in a client- or | |
# server-side shared library. | |
.PHONY: all clean | |
# Install `babel-cli` in a project to get the transpiler. | |
babel := node_modules/.bin/babel | |
# Identify modules to be transpiled by recursively searching the `src/` | |
# directory. |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} | |
-- FlexibleInstances and MultiParamTypeClasses are necessary for the | |
-- LayoutClass instance declaration of Flip. | |
-- I use two monitors. The default tiled layout in XMonad, Tall, puts | |
-- the master window on the left side of the screen. That feels right | |
-- for my right screen. But for my left screen I would prefer the | |
-- master window to be on the right side of the screen because that side |
@-moz-document url(chrome://browser/content/browser.xul), | |
url(chrome://browser/content/browser.xhtml) { | |
/* hide horizontal tabs at the top of the window */ | |
#TabsToolbar > * { | |
visibility: collapse; | |
} | |
/* hide navigation bar when it is not focused; use Ctrl+L to get focus */ | |
#main-window:not([customizing]) #navigator-toolbox:not(:focus-within):not(:hover) { |
With a bigger display 2x scaling might be too big. I'm trying out experimental support for fractional scaling in Gnome. To opt out again it is necessary to undo this experimental features setting:
$ gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
In addition to fractional scaling that setting allows different scaling factors per monitor!
The only issue I'm seeing so far is that apps running with XWayland look fuzzy. That includes web browsers. But! Firefox and Chrome both have opt-in support for Wayland which fixes the problem.
# Netlify configuration to set up a Mastodon handle for your own domain that | |
# forwards to your real account. This configuration allows people to search for | |
# me with @jesse@sitr.us, and to find me @hallettj@hachyderm.io. | |
# | |
# Put a configuration like this in a file called _redirects in the *publish | |
# directory* of your Netlify project. For my Gatsby site I put the file in | |
# static/_redirects, and at build time it gets copied to public/_redirects. | |
# | |
# Redirect documentation for Netlify is at https://docs.netlify.com/routing/redirects/redirect-options/ | |
# Test redirect rules in the playground, https://play.netlify.com/redirects |
/* | |
* Example of a state monad in use. This is adapted from an example on | |
* the Haskell Wiki: | |
* http://www.haskell.org/haskellwiki/State_Monad#Complete_and_Concrete_Example_1 | |
*/ | |
require(['state', 'qunit'], function(state, qunit) { | |
/* | |
* playGame() is a recursive function that given an array of moves | |
* defines an algorithm for constructing a final game score. Along |
#!/bin/sh -e | |
if [ ! $SBT_VERSION ]; then SBT_VERSION=0.11.0; fi | |
if [ ! $SBT_DIR ]; then SBT_DIR=$HOME/.sbt; fi | |
if [ ! $SBT_FILENAME ]; then SBT_FILENAME=sbt-launch-$SBT_VERSION.jar; fi | |
if [ ! $SBT_LOCATION ]; then SBT_LOCATION=$SBT_DIR/$SBT_FILENAME; fi | |
if expr match $SBT_VERSION "0.7" > /dev/null; | |
then | |
SBT_URL="http://simple-build-tool.googlecode.com/files/$SBT_FILENAME" |