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
(defn css-color [color] | |
(let [ colors (rest (clojure.string/split color #"")) | |
red (take 2 colors) | |
green (take 2 (drop 2 colors)) | |
blue (take 2 (drop 4 colors))] | |
(map #(-> (conj % "0x") (clojure.string/join) (read-string)) [red green blue]))) |
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.stdenv.mkDerivation | |
{ | |
name = "code-server"; | |
src = pkgs.fetchurl | |
( | |
let | |
INSTALL_ARCH = "x86_64"; | |
INSTALL_TARGET = "unknown-linux-gnu"; | |
in | |
{ |
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
class BufferedChan<T> { | |
cap: number | |
sendx = new Uint32Array(2) | |
recvx = new Uint32Array(2) | |
buf: { lap: number, val: T | null }[] | |
closed = false | |
// Pending senders/receivers | |
sendq: Array<() => void> = [] |
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
server { | |
listen = "0.0.0.0:7922" # The default | |
# Set this to the contents of lazyssh_host_key generated above. | |
host_key = <<-EOF | |
-----BEGIN OPENSSH PRIVATE KEY----- | |
... | |
-----END OPENSSH PRIVATE KEY----- | |
EOF |
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
module "nixos_image_20_09" { | |
source = "../terraform-nixos/aws_image_nixos" | |
release = "20.09" | |
} | |
resource "aws_key_pair" "nix_key" { | |
key_name = "nix_key" | |
public_key = file("~/.ssh/aws_nix.pub") | |
} |
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 { Dice } from 'https://deno.land/x/dodecasaurus/mod.ts'; | |
import { Node } from 'https://deno.land/x/router/mod.ts' | |
import { | |
APIGatewayProxyEvent, | |
APIGatewayProxyResult, | |
Context | |
} from "https://deno.land/x/lambda/mod.ts"; | |
const root = new Node(); |
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 { | |
APIGatewayProxyEvent, | |
APIGatewayProxyResult, | |
Context | |
} from "https://deno.land/x/lambda/mod.ts"; | |
export default async function ( | |
event: APIGatewayProxyEvent, | |
context: Context | |
): Promise<APIGatewayProxyResult> { |
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
FROM alpine:latest | |
WORKDIR /app | |
RUN apk add cargo | |
COPY . . | |
RUN cargo build --release | |
CMD ["/app/target/release/hello"] |
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
use async_std; | |
use futures_timer::Delay; | |
use job_scheduler::{Job, JobScheduler}; | |
use std::time::Duration; | |
#[async_std::main] | |
async fn main() { | |
let a = async { 1u8 }; | |
let b = a.await; | |
let mut sched = JobScheduler::new(); |
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
// Put this file alongside your JS code and VS Code will automatically pick it up! | |
interface Window { | |
RunKit: GlobalRunKit | |
} | |
type GlobalRunKit = { | |
createNotebook: (options: EmbedOptions) => NotebookEmbed | |
} | |
type EmbedOptions = { |
NewerOlder