Skip to content

Instantly share code, notes, and snippets.

View killerswan's full-sized avatar

Kevin Cantú killerswan

View GitHub Profile
terraform {
/*
backend "s3" {
shared_credentials_file = "~/.aws/credentials"
profile = "mfa"
bucket = "terraform-killerswan-demos"
key = "interviews/next-v1.tfstate"
region = "us-west-2"
# note: add a partition key of LockID (string)
dynamodb_table = "terraform-state-lock-demo-for-next"
@killerswan
killerswan / tco.py
Created April 19, 2021 05:44 — forked from sagnibak/tco.py
Implementation of a tail-call optimizing function decorator and accompanying types in Python.
from dataclasses import dataclass, field
from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union
ReturnType = TypeVar("ReturnType")
@dataclass
class TailCall:
args: Tuple[Any, ...] = field(default_factory=tuple)
@killerswan
killerswan / git_notes.md
Created November 22, 2019 08:39 — forked from jaygooby/git_notes.md
Git, you bloody git

Remove all local tracking branches to a remote & then delete the remote

git remote prune origin && git remote rm origin

Force checkout a branch to avoid the commit or stash your changes warning

Sometimes when you want to checkout a branch, even though your current branch is clean, you'll get a failed partial checkout, because a file in your current branch will be changed by the new branch (Looking at you .xcodeproj files). As long as you know your current branch is clean and up-to-date, -f force the checkout

git checkout -f the_branch

@killerswan
killerswan / .git--config
Created April 1, 2017 15:02
problem with git and GitHub fetching pull requests
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "kevin"]
url = [email protected]:killerswan/ponyc.git
fetch = +refs/heads/*:refs/remotes/kevin/*
@killerswan
killerswan / [email protected]
Created March 22, 2017 00:50
Pony's (upstream) vs. Julia's (customized) [email protected]
--- homebrew-pony/Formula/[email protected] 2017-03-21 04:31:09.000000000 -0700
+++ homebrew-julia/llvm39-julia.rb 2017-03-21 17:27:53.000000000 -0700
@@ -17,7 +17,7 @@
end
end
-class LlvmAT39 < Formula
+class Llvm39Julia < Formula
desc "Next-gen compiler infrastructure"
homepage "http://llvm.org/"
@killerswan
killerswan / [email protected]
Last active March 22, 2017 00:50
Pony's (upstream) vs. Julia's (customized) [email protected]
--- homebrew-pony/Formula/[email protected] 2017-03-21 04:31:09.000000000 -0700
+++ homebrew-julia/llvm37-julia.rb 2017-03-21 17:27:53.000000000 -0700
@@ -1,6 +1,26 @@
-class LlvmAT37 < Formula
- desc "Next-gen compiler infrastructure"
+class CodesignRequirement < Requirement
+ include FileUtils
+ fatal true
+
+ satisfy(:build_env => false) do
@killerswan
killerswan / pony-deps.md
Last active March 16, 2017 02:32
separate dependency builds: LLVM, PCRE, etc.

The regression caused by Homebrew's removal of [email protected] (see homebrew-core # 11110) has caused some discussion reminding me of an idea I had a couple months ago.

It'd be nifty if we get more dependency builds out of the ponyc build (and into their own CI jobs). Looking through our current setup, I think the following table is roughly accurate right now.

(Although this table does not mention the Visual Studio 2015 image on AppVeyor, or the trusty distro, ubuntu-toolchain-r-test package, g++-5 package, or RVM 2.2.3 (Ruby) config on Travis.)

I'm using (❤️=todo/💛=hmm/💚=yay) hearts to indicate my feelings:

Build dependency Pony platform Third party build Package build Pony build usage Feels
@killerswan
killerswan / pr.md
Created August 26, 2016 12:13 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

rvm:
- 2.2.3
install:
- if [ "${TRAVIS_OS_NAME}" = "linux" ];
then
...
rvm use 2.2.3 --default;
sudo gem install fpm;
fi;