Skip to content

Instantly share code, notes, and snippets.

set -sg escape-time 0
set -g prefix C-a
setw -g aggressive-resize on
# bind-key C-a last-window
# Set status bar
# set -g remain-on-exit on
set -g status-bg black
set -g status-fg white
@maxcan
maxcan / pulumi.ts
Last active February 3, 2022 21:17
pulumi - fargate / s3 / lambda
// https://github.com/pulumi/examples/blob/master/aws-ts-pulumi-miniflux/index.ts
import * as pulumi from "@pulumi/pulumi";
import * as mime from "mime";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import { PrivateVirtualInterface } from "@pulumi/aws/directconnect";
import { Output } from "@pulumi/pulumi";
import { AnyTxtRecord } from "dns";
import { GraphQLApi } from "@pulumi/aws/appsync";
@maxcan
maxcan / script.ts
Created February 3, 2022 20:53
Upload gql files to hasura allowed list
#!/usr/bin/env ./node_modules/.bin/ts-node-script
import { $, argv, fs } from "zx";
import { parse, print, visit, DefinitionNode } from "graphql";
import axios from "axios";
const MAKE_ENV = process.env.MAKE_ENV;
if (!MAKE_ENV) {
@maxcan
maxcan / shorthand args
Created September 20, 2014 16:06
type inference failing on closures
// this compiles:
private func loadMessages() {
getMsgList(self.auth).map() { (listRes:Result<MsgList>) -> Void in
switch(listRes) {
case let .Value(v):
die("swift needs type holes",43)
case let .Error(e): die("ERROR getting msgres: \(e)", 6)
}
return
}
//
// GmailAPI.swift
// tinmail
//
// Created by Max Cantor on 7/2/14.
// Copyright (c) 2014 Max Cantor. All rights reserved.
//
import Foundation
import swiftz
@maxcan
maxcan / gist:ca1ae069d4283c3fc1fe
Created June 16, 2014 00:43
yesod-auth-1.3.1 build failure
Yesod/Auth/GoogleEmail2.hs:78:23:
Could not deduce (transformers-base-0.4.2:Control.Monad.Base.MonadBase
IO m)
arising from a use of ‘liftBase’
from the context (MonadHandler m)
bound by the type signature for
getCreateCsrfToken :: MonadHandler m => m Text
at Yesod/Auth/GoogleEmail2.hs:72:23-46
In a stmt of a 'do' block: stdgen <- liftBase newStdGen
In the expression:
@maxcan
maxcan / Setup.hs
Created September 4, 2013 20:13
Sample Setup.hs file for creating .lock.yaml files for Cabal based Haskell projects
{-# LANGUAGE OverloadedStrings #-}
import Distribution.Simple
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup
import Distribution.PackageDescription
import System.IO (writeFile)
import qualified Data.Text as T
main :: IO ()
main = defaultMainWithHooks simpleUserHooks {postConf = printLockFile}
@maxcan
maxcan / README.md
Created November 22, 2012 01:42 — forked from mbostock/.block
Stacked Area Chart

This stacked area chart is constructed from a TSV file storing the market share of several popular web browsers over the last year. Data is from Clicky Web Analytics. The chart employs conventional margins and a number of D3 features:

@maxcan
maxcan / gist:3841512
Created October 5, 2012 18:24
jitsu deploy timeout
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: socket hang up
error: at createHangUpError (http.js:1263:15)
error: at Socket.socketOnEnd (http.js:1351:23)
error: at TCP.onread (net.js:418:26)
help: For help with this error contact Nodejitsu Support:
help: webchat: <http://webchat.nodejitsu.com/>
help: irc: <irc://chat.freenode.net/#nodejitsu>
help: email: <support@nodejitsu.com>