Skip to content

Instantly share code, notes, and snippets.

View squaremo's full-sized avatar
💭
how does computer

Michael Bridgen squaremo

💭
how does computer
View GitHub Profile
@squaremo
squaremo / index.js
Created June 10, 2022 08:52
Create a lambda from a string
"use strict";
const pulumi = require("@pulumi/pulumi");
const asset = require('@pulumi/pulumi/asset');
const aws = require("@pulumi/aws");
const script = new asset.StringAsset(`#!/bin/sh
echo "file executed!"
`);
const archive = new asset.AssetArchive({
// Naively create a CRD from a file (from a URL)
"use strict";
const k8s = require("@pulumi/kubernetes");
function installCRDs(name, fileURL) {
return new k8s.yaml.ConfigFile(name, {file: fileURL});
}
exports.crds = installCRDs('pulumi-stack-crd', "https://raw.githubusercontent.com/pulumi/pulumi-kubernetes-operator/master/deploy/crds/pulumi.com_stacks.yaml");
package main
import (
"bytes"
"context"
"fmt"
"io"
"os"
"os/exec"
"sync"
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
var amqp = require('../channel_api')
var Promise = require('bluebird')
process.on('error', err => {
console.log('#338: process error', err)
})
process.on('uncaughtException', function (err) {
console.log('#338: process uncaught exception', err)
})
HTTP/1.1 200 OK
Server: nginx/1.13.3
Date: Thu, 23 Nov 2017 15:54:10 GMT
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Content-Length: 14781
Connection: keep-alive
Docker-Content-Digest: sha256:43ebd38f6d8f4ba5659ac6cf34706d133b1e92924d2df36135d3c781d7f472f9
X-Frame-Options: DENY
Strict-Transport-Security: max-age=63072000; preload
@squaremo
squaremo / main.go
Created October 5, 2017 22:13
docker reg experimentation
package main
import (
"io/ioutil"
"os"
"github.com/heroku/docker-registry-client/registry"
)
func bail(err error) {
(defn hello-loop [inbox outbox control]
(go-loop []
(alt! ;; choice
inbox ([name] (do
(>! outbox (str "Hello" name)) ;; put
(recur))) ;; loop
control nil)))
(let [in (chan) ;; construct a channel
out (chan)
@squaremo
squaremo / stress.js
Created July 7, 2014 08:52
Testing RabbitMQ's ability to recover from a lot of channels and queues
// npm install amqplib
var rmq = require ('amqplib/callback_api');
TOTAL = process.argv[2] || 5000;
// three local cluster nodes
var nodes = [25671, 25672, 25673];
var connected = latch(nodes.length, go);

Keybase proof

I hereby claim:

  • I am squaremo on github.
  • I am squaremo (https://keybase.io/squaremo) on keybase.
  • I have a public key whose fingerprint is BA8E EA68 BE80 97D9 BE8A E911 B105 5652 14C3 5205

To claim this, I am signing this object: