I hereby claim:
- I am dsimunic on github.
- I am dsimunic (https://keybase.io/dsimunic) on keybase.
- I have a public key ASA4sK7jOta7QTZfrLtVZUgeWob_0qzFPm8FWA9d72CaPQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import Html exposing (..) | |
import Html.App exposing (program) | |
import Svg exposing (circle, line, svg) | |
import Svg.Attributes exposing (..) | |
import Time exposing (Time, minute, second) | |
main = | |
program { init = init, view = view, update = update, subscriptions = subs } |
open System.IO | |
let splitRows (s:string) = | |
new StringReader(s) | |
|> Seq.unfold (fun sr -> | |
match sr.ReadLine() with | |
| null -> sr.Dispose(); None | |
| str -> Some(str, sr)) | |
|> Seq.toArray |
'use strict'; | |
var m = require('mithril'); | |
var extend = require('lodash').extend; | |
var setFocus = require('../util/viewhelper').setFocus; | |
var keymage = require('keymage'); | |
function noop(){} | |
function addClass(el, className) { |
Docker can start a container with a specific user by passing the id on the command line with -u
.
The parameter to the -u
switch is either a username or id of a user existing inside the container. More precisely,
the container must have valid /etc/passwd
file with the defined user:
$ mkdir etc
$ echo 'postgres:x:1000:1000::/home/postgres:/bin/sh' > etc/passwd
While not needed for this simple experiment, we might want to create group and shadow files for completeness:
var animator = ( function animatorScope(){ | |
var animating = false; | |
return function animator( input, incoming, outgoing, alwaysAnimate ){ | |
var module = { | |
controller : input.controller || function(){}, | |
view : function animatedView( ctrl ){ | |
var view = ( input.view || input )( ctrl ); | |
var cfg = view.attrs.config; | |
type RomanDigit = Nil | I | V | X | L | C | D | M | |
let romanDigitToInt aRomanDigit = | |
match aRomanDigit with | |
| Nil -> 0 | |
| I -> 1 | |
| V -> 5 | |
| X -> 10 | |
| L -> 50 | |
| C -> 100 |
apt-get install -y wget build-essential gettext autoconf automake libtool | |
MONO_VERSION=3.4.0 | |
wget http://download.mono-project.com/sources/mono/mono-${MONO_VERSION}.tar.bz2 | |
bunzip2 -df mono-${MONO_VERSION}.tar.bz2 | |
tar -xf mono-${MONO_VERSION}.tar | |
cd mono-${MONO_VERSION} |
-- Obviously, if a standalone file is called with an argument that corresponds to a loaded file, it will think it's required. | |
-- For example: | |
-- lua caller_test.lua _G | |
-- will choose the else branch. | |
-- For our purposes, though, this is good enough. | |
if not _G.package.loaded[...] then | |
print("Running standalone") | |
else | |
print("Required") | |
end |
public static void OverwriteConsoleMessage(string message) | |
{ | |
Console.CursorLeft = 0; | |
int maxCharacterWidth = Console.WindowWidth - 1; | |
if (message.Length > maxCharacterWidth) { | |
message = message.Substring(0, maxCharacterWidth - 3) + "..."; | |
} | |
message = message + new string(' ', maxCharacterWidth - message.Length); | |
Console.Write(message); | |
} |