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
$header = "..."; | |
$parsed = array_map(function($x) { return array_map("trim", explode(":", $x, 2)); },array_filter(array_map("trim", explode("\n", $header)))); |
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
public delegate G TaskFunc<G> () throws Error; | |
public async G run_in_thread<G> (owned TaskFunc<G> func) throws Error { | |
SourceFunc resume = run_in_thread.callback; | |
Error err = null; | |
G result = null; | |
new Thread<void*> (null, () => { | |
try { | |
result = func (); | |
} catch (Error e) { |
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
# See http://lethalman.blogspot.it/2014/01/intersection-test-and-optimal.html | |
# Run as glpsol --tmlim 5 -m alloc.mod | |
param cols integer >= 0; | |
param rows integer >= 0; | |
param n integer >= 1; | |
param w{1..n} integer >= 1 <= cols; | |
param M := cols+rows; | |
param C := 1/(2*n*rows); |
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
[Test (name = "/foo")] | |
public void foo () { | |
message ("foo"); | |
} | |
[Test (name = "/bar")] | |
public void bar () { | |
message ("bar"); | |
} |
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 isalpha(c) { | |
return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))); | |
} | |
function isdigit(c) { | |
return ((c >= '0') && (c <= '9')); | |
} | |
function isalnum(c) { | |
return (isalpha(c) || isdigit(c)); |
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
services.nagios4.cgiConfigFile = pkgs.writeText "nagios.cgi.conf" '' | |
main_config_file=${cfg.mainConfigFile} | |
use_authentication=1 | |
url_html_path=${cfg.urlPath} | |
authorized_for_system_information=lethalman | |
authorized_for_system_commands=lethalman | |
authorized_for_configuration_information=lethalman | |
authorized_for_all_hosts=lethalman | |
authorized_for_all_host_commands=lethalman | |
authorized_for_all_services=lethalman |
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
with import <nixpkgs> {}; | |
{ | |
inherit (e18) efl evas emotion elementary enlightenment terminology econnman; | |
} |
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
{ nixpkgs }: | |
let | |
combined = import "${nixpkgs}/nixos/release-combined.nix" { inherit nixpkgs; supportedSystems = [ "x86_64-linux" ]; }; | |
nixos = combined.nixos; | |
peek = x: x.x86_64-linux; | |
in | |
{ | |
simple = peek nixos.tests.simple; | |
gnome3 = peek nixos.tests.gnome3; |
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
pkgs: attrs: | |
with pkgs; | |
let defaultAttrs = { | |
builder = "${bash}/bin/bash"; | |
args = [ ./builder.sh ]; | |
setup = ./setup.sh; | |
baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ]; | |
buildInputs = []; | |
system = builtins.currentSystem; | |
}; |
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
{ nixpkgs }: | |
let | |
combined = import "${nixpkgs}/nixos/release-combined.nix" { inherit nixpkgs; supportedSystems = [ "x86_64-linux" ]; }; | |
tests = combined.nixos.tests; | |
peek = x: x.x86_64-linux; | |
in | |
{ | |
simple = peek tests.simple; | |
openssh = peek tests.openssh; |
OlderNewer