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
{ | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09"; | |
}; | |
outputs = {self, nixpkgs}: { | |
packages."x86_64-linux" = with nixpkgs.legacyPackages."x86_64-linux"; rec { | |
erlang_24 = erlang.overrideAttrs (oldAttrs: rec { | |
name = "erlang-${version}"; | |
version = "24.0"; |
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> { }; | |
let | |
rubyVersion = "2.3.6"; | |
rubygemsVersion = "2.7.6"; | |
rubygemsSrc = fetchurl { | |
url = "http://production.cf.rubygems.org/rubygems/rubygems-${rubygemsVersion}.tgz"; | |
sha256 = "1sqy6z1kngq91nxmv1hw4xhw1ycwx9s76hfbpcdlgkm9haji9xv7"; | |
}; | |
rubySrc = fetchurl { |
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 functools | |
from pprint import pprint | |
from queue import Queue | |
class TransitionEvent: | |
def __init__(self, from_state, to_state): | |
self.from_state = from_state | |
self.to_state = to_state |
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
[ 0.000000] Linux version 4.9.85 (nixbld@localhost) (gcc version 7.3.0 (GCC) ) #1-NixOS SMP Wed Feb 28 09:18:34 UTC 2018 | |
[ 0.000000] Command line: earlyprintk=serial console=ttyS0 boot.trace root=LABEL=NIXOS_ISO | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' | |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' | |
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 | |
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. | |
[ 0.000000] x86/fpu: Using 'eager' FPU context switches. | |
[ 0.000000] e820: BIOS-provided physical RAM map: | |
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable |
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
#lang racket | |
(require ffi/unsafe | |
ffi/unsafe/define) | |
(define-ffi-definer define-libc (ffi-lib #f)) | |
(define-libc ioctl (_fun #:save-errno 'posix | |
(fd : _int) (request : _ulong) (data : _pointer) |
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
hello from the web server |
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 logging | |
class LogStream(object): | |
def __init__(self, logger='logstream', log_level='INFO', **extra): | |
self.logger = logging.getLogger(logger) | |
self.log_level = getattr(logging, log_level, 'INFO') | |
self.extra = extra | |
def __call__(self, data): |
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
repositories: | |
s3: | |
bucket: "my-snapshots-bucket" | |
region: "us-east-1" |
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
=> (defmacro with-g [&rest args] (with-gensyms [sym] `(let [[~sym 10]] (print ~sym)))) | |
=> (with-g) | |
10 | |
=> (defmacro/g! g-bang [&rest args] `(let [[~g!sym 10]] (print ~g!sym))) | |
File "<input>", line 1, column 1 | |
(defmacro/g! g-bang [&rest args] `(let [[~g!sym 10]] (print ~g!sym))) | |
^-------------------------------------------------------------------^ | |
HyMacroExpansionError: `defmacro/g!' object has no attribute 'startswith' |
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-context {:var "value" :var2 "value2"} | |
(with-context {:var "different value"} | |
(do-something)) ; {:var "different value" :var2 "value2"} | |
(do-something) ; {:var "value" :var2 "value2"} | |
(with-context {:var3 "value3"} | |
(do-something))) ; {:var "value" :var2 "value2" :var3 "value3"} |
NewerOlder