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 stripe | |
| async def sync_products( | |
| live_key: str, sandbox_key: str, idempotency_suffix: str = "v0" | |
| ): | |
| products = await stripe.Product.list_async(api_key=live_key) | |
| for product in products: | |
| new_product = await stripe.Product.create_async( | |
| api_key=sandbox_key, |
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
| # Change history file format to SQLite in ~/.config/nushell/config.nu | |
| $env.config.history.file_format = 'sqlite' | |
| # Import Atuin history | |
| open ~/.local/share/atuin/history.db | |
| | query db "SELECT * FROM history" | |
| | each {|row| { | |
| command: $row.command, | |
| start_timestamp: ($row.timestamp | into datetime), | |
| duration: ([$row.duration, 0] | math max | into duration), |
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
| diff --git a/crates/languages/src/rust.rs b/crates/languages/src/rust.rs | |
| index ebf1d0d0e3..d2c5bf4d85 100644 | |
| --- a/crates/languages/src/rust.rs | |
| +++ b/crates/languages/src/rust.rs | |
| @@ -469,13 +469,13 @@ impl ContextProvider for RustContextProvider { | |
| }, | |
| TaskTemplate { | |
| label: format!( | |
| - "cargo test -p {} {} -- --nocapture", | |
| + "cargo ltest -p {} {} -- --nocapture", |
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
| // MIT License | |
| // | |
| // Copyright (c) 2023 Oxide Computer Company | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
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
| FROM golang:latest AS builder | |
| ENV GOARCH=arm64 | |
| ENV GOOS=linux | |
| ENV CGO_ENABLED=0 | |
| WORKDIR /build | |
| RUN go install go.universe.tf/netboot/cmd/pixiecore@latest |
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
| use tokio::net::UdpSocket; | |
| use std::net::{Ipv4Addr, SocketAddrV4}; | |
| pub async fn send_udp_message() { | |
| let google_dns = Ipv4Addr::new(8, 8, 8, 8); | |
| let buffer = &[ | |
| 32, 189, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 4, 101, 54, 55, 51, 5, 100, 115, 99, 101, 57, 10, 97, | |
| 107, 97, 109, 97, 105, 101, 100, 103, 101, 3, 110, 101, 116, 0, 0, 65, 0, 1, | |
| ]; |
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 { randomFillSync } from "node:crypto"; | |
| // Defined for length >= 2 | |
| // | |
| // From https://stackoverflow.com/a/27747377/13300239 | |
| export function randomStr(length: number): string { | |
| const rnd = new Uint8Array(length / 2); | |
| randomFillSync(rnd); | |
| // i.e. 0-255 -> '00'-'ff' |
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 zio.logging.Logging | |
| import zio.ZIO | |
| import akka.actor.ActorSystem | |
| import akka.http.scaladsl.Http | |
| import akka.http.scaladsl.model.HttpResponse | |
| import akka.http.scaladsl.server.Directives._ | |
| import scala.concurrent.{ExecutionContext, Future} |
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
| % | |
| % Generate Poission spike train using a uniform probability distribution | |
| % | |
| % Generates up to r * T spikes. | |
| % None of the spike times will exceed T. | |
| % | |
| % @param r firing rate (Hz) | |
| % @param T spike train duration (seconds) | |
| % @param dt time resolution (seconds) | |
| % @return V Spike times (seconds) |
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
| processor : 0 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 85 | |
| model name : Intel Xeon Processor (Skylake, IBRS) | |
| stepping : 4 | |
| microcode : 0x1 | |
| cpu MHz : 2099.998 | |
| cache size : 16384 KB | |
| physical id : 0 |
NewerOlder