This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WIRED_ONSITE="eth0" | |
WIFI_ONSITE="onsite_ssid" | |
VPN_ONSITE="vpn-onsite" | |
VPN_OFFSITE="vpn-offsite" | |
function online { | |
nmcli con show --active | grep -qs "^$1" | |
return $? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
// Helper function for matching against an ADT. | |
export function match<A,B>(matcher: A): (match: (matcher: A) => B) => B { | |
return match => match(matcher) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a test to get a better understanding of Go's scheduling. | |
// The hypothesis is that if the goroutine worker pool is saturated with | |
// long-running tasks, then a goroutine that is queued later will not be | |
// scheduled until the long-running tasks complete. | |
// | |
// Tested in Go 1.7 using this command: | |
// | |
// go build -gcflags '-N -l' blocker.go && ./blocker | |
// | |
// The `gcflags` setting is my attempt to disable inlining, to give |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (text) | |
import List exposing (concatMap, filter) | |
import List.Extra exposing (uniqueBy) | |
type alias CityId = Int | |
type alias City = | |
{ id: CityId | |
, name: String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function promisify<T, Args: *> ( | |
taskFn: (...args: Args) => Task<T> | |
): Task<(...args: Args) => Promise<T>> { | |
/* ... */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE NamedFieldPuns #-} | |
-------------------------------------------------------------------------------- | |
-- | | |
-- Module : Custom.Hooks.FloatFullScreenFirefox | |
-- | |
-- Maintainer : Jesse Hallett <[email protected]> | |
-- | |
-- As of version 57 Firefox for Linux does not set full screen state in Xorg | |
-- when entering full screen mode. This module exports an event hook that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Concept for emulating higher-kinded types using Flow. Instead of passing | |
* a type that has not been applied to parameters, this pattern passes | |
* a type-level function that will map a parameter type to the desired | |
* higher-kinded type applied to the given parameter. | |
* | |
* @flow | |
*/ | |
// a higher-kinded type is represented indirectly via a type-level function from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styles from "part:@sanity/base/theme/forms/text-input-style" | |
import FormField from "part:@sanity/components/formfields/default" | |
import { withDocument } from "part:@sanity/form-builder" | |
import PatchEvent, { set, unset } from "part:@sanity/form-builder/patch-event" | |
import * as React from "react" | |
import Datetime from "react-datetime" | |
class DatetimeInputRaw extends React.Component { | |
render() { |