This file contains hidden or 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
// see org.robolectric.plugins.DefaultSdkProvider | |
enum class Sdk(val apiLevel: Int, val androidVersion: String, val robolectricVersion: String) { | |
JELLY_BEAN(16, "4.1.2_r1", "r1"), | |
JELLY_BEAN_MR1(17, "4.2.2_r1.2", "r1"), | |
JELLY_BEAN_MR2(18, "4.3_r2", "r1"), | |
KITKAT(19, "4.4_r1", "r2"), | |
LOLLIPOP(21, "5.0.2_r3", "r0"), | |
LOLLIPOP_MR1(22, "5.1.1_r9", "r2"), | |
M(23, "6.0.1_r3", "r1"), | |
N(24, "7.0.0_r1", "r1"), |
This file contains hidden or 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
#!/usr/bin/env stack | |
-- stack script --resolver lts --package unix | |
module Main where | |
import Control.Concurrent | |
import Control.Concurrent.MVar | |
import System.Posix | |
main :: IO () | |
main = do |
This file contains hidden or 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
#!/usr/bin/env stack | |
-- stack script --resolver lts --package "ioctl monad-loops process unix" | |
{-# LANGUAGE CPP, MultiParamTypeClasses, NondecreasingIndentation #-} | |
module Main where | |
import Control.Concurrent (forkFinally, killThread) | |
import Control.Concurrent.MVar (newEmptyMVar, takeMVar, tryPutMVar) | |
import Control.Exception (bracket, catchJust, finally) | |
import Control.Monad (void, when) | |
import Control.Monad.Fix (fix) |
This file contains hidden or 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
#include <stdlib.h> | |
#include <string.h> | |
static void swap(int *a, int *b) { | |
if (a != b) { | |
int c = *a; | |
*a = *b; | |
*b = c; | |
} | |
} |
This file contains hidden or 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 android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.Outline | |
import android.graphics.Path | |
import android.graphics.Rect | |
import android.graphics.Region | |
import android.graphics.drawable.Drawable | |
import android.graphics.drawable.LevelListDrawable | |
import android.os.Build | |
import android.util.AttributeSet |
This file contains hidden or 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 | |
set -euo pipefail | |
declare -r IFACE=${IFACE:-wg0} | |
declare -r CONFIG_FILE=${CONFIG_FILE:-/etc/systemd/network/90-${IFACE}.netdev} | |
declare -r BASE_TIME=${BASE_TIME:-$(date -d '5 minutes ago' +%s)} | |
declare -A PEERS=() | |
declare PEER_SECTION= PUBLIC_KEY= ENDPOINT= |
This file contains hidden or 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
[Unit] | |
Description=Chromoting Server for X11 | |
Requires=display-manager.service | |
Wants=network-online.target user@%i.service | |
After=display-manager.service network-online.target | |
[Service] | |
User=%I | |
Group=chrome-remote-desktop | |
PermissionsStartOnly=true |
Source: Sister Cities of the World + Graphviz
7158 18672 2463 731 0.7578 198 0.8743
- 7158 nodes
- 18672 edges
- 2463 connected components
- 731 strongly connected components
- 0.7578 fraction of nodes in a non-trivial strongly connected components
- 198 maximum degree
This file contains hidden or 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 | |
set -euo pipefail | |
inhibit() { | |
while { read -n1 -r -s -t30 || [[ $? -gt 128 ]]; } && [[ -z ${REPLY} ]]; do | |
dbus-send --session --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SimulateUserActivity | |
done | |
} | |
if [[ $# -gt 0 ]]; then | |
coproc inhibit >&2 | |
command "$@" {COPROC[0]}<&- {COPROC[1]}>&- |