Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ctaggart
ctaggart / create_source.rs
Last active March 28, 2024 16:34
Creating and Printing a TypeScript AST from Rust
#![allow(non_snake_case)]
#![allow(dead_code)]
// port of:
// Creating and Printing a TypeScript AST
// https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#creating-and-printing-a-typescript-ast
extern crate typescript_ts as ts;
extern crate chakracore;
use chakracore::context::ContextGuard;
Usage...
Vcxsrv [:<display>] [option]
:display-number
Vcxsrv runs as the given display-number, which defaults to 0.
To run multiple instances, use unique display-numbers.
-a # default pointer acceleration (factor)
-ac disable access control restrictions
-audit int set audit trail level
kubectl run myubuntu --image ubuntu --rm -ti --restart=Never --overrides='
{
"metadata": {
"labels": {
"diditwork": "itdid"
}
},
"spec": {
"containers": [
{
@ctaggart
ctaggart / watchPods.go
Last active March 13, 2023 15:12
Kubernetes watch pods
// some updates for https://rsmitty.github.io/Kubernetes-Events/
// and http://blog.ctaggart.com/2016/09/accessing-kubernetes-api-on-google.html
import (
"encoding/base64"
"fmt"
"log"
"net/http"
"time"
@ctaggart
ctaggart / ClickOnceProfile.pubxml.user.template.xml
Last active December 25, 2020 00:08
ClickOnce for Rust Apps
<Project>
<PropertyGroup>
<InstallUrl>https://ctaggart.github.io/minesweeper-rs/</InstallUrl>
<ManifestCertificateThumbprint>1A92BF20220B301077205787F406B1BCEE6DA97E</ManifestCertificateThumbprint>
</PropertyGroup>
</Project>
@ctaggart
ctaggart / Cargo.toml
Created August 22, 2020 02:13
cmdproxy
[package]
name = "cmdproxy"
version = "0.1.0"
authors = ["Cameron Taggart <cameron.taggart@gmail.com>"]
edition = "2018"
[dependencies]
# tokio = { version = "0.2", features = ["macros", "io-std", "io-util", "fs", "process"] }
tokio = { version = "0.2", features = ["full"] }
bytes = "*"
mod logging;
use node::http::{create_server, IncomingMessage, RequestListener, ServerResponse};
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn run() {
// based on https://nodejs.org/en/docs/guides/getting-started-guide/
let default_port = 3000.;
let port = match node::PROCESS.env().get("PORT") {
impl AsRef<OutgoingMessage> for ServerResponse {
fn as_ref(&self) -> &OutgoingMessage {
self.unchecked_ref()
}
}
impl From<ServerResponse> for OutgoingMessage {
fn from(child: ServerResponse) -> Self {
child.unchecked_into()
}
}
mod logging;
use js_sys::Array;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn run(argv: &Array) {
node::CONSOLE.log_va0(argv);
let args: Vec<String> = argv.iter().flat_map(|v| v.as_string()).collect();
log!("args: {:?}", args);
const { run } = require('./pkg/node_console_hello_world.js');
run(process.argv);