Skip to content

Instantly share code, notes, and snippets.

@simpsoka
simpsoka / Leadership-CI.md
Last active December 20, 2023 15:40
This is a list of questions to check our decision making.

Do I want to die on this hill?

  • Pass: This is morally good and if not handled has long term consequences
  • Fail: This if self serving

Am I including everyone?

  • Pass: My ego is not driving this conversation
  • Fail: The people in this conversation will only tell me I'm right and not push back
@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@malisper
malisper / gist:2d6ec4077f3097559b2206663ae39bec
Created February 24, 2019 18:36
SQL Queries that Produce Fractals
-- Sierpinski's Triangle.
WITH points AS (
SELECT ROW, col FROM generate_series(0, 63) a(ROW)
CROSS JOIN generate_series(0, 63) b(col)
ORDER BY ROW DESC, col ASC
), marked_points AS (
SELECT ROW, col, (CASE WHEN ROW & col != 0
THEN ' '
ELSE '*'
END) AS marker
@dienhoa
dienhoa / tabular-rf.ipynb
Created October 12, 2018 17:39
data preprocessing with Tabular Module fast.ai
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emwalker
emwalker / setup.md
Last active February 27, 2021 07:06
Geting set up with Cayley and Postgres (April 2018)

Getting set up with Cayley and Postgres (April 2018)

Initialize the database

$ createdb testdb
$ wget https://github.com/cayleygraph/cayley/releases/download/v0.7.2/cayley_0.7.2_darwin_amd64.tar.gz
$ tar zxvf cayley_0.7.2_darwin_amd64.tar.gz
$ cat >cayley.cfg.json
{
  "store": {
@danbo
danbo / cayley-visualizer.html
Last active April 10, 2019 03:23
cayley visualizer
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script>
<script src="https://unpkg.com/d3-graphviz@1.4.0/build/d3-graphviz.min.js"></script>
<script type = "text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
@demofly
demofly / GLB.sh
Created April 10, 2018 21:04
How to attach your GKE NodePort nginx-service to a precreated GLB
#!/bin/bash
#set -x
## Predefined variables ##
#export GCP_CI_SVC_ACCOUNT=$(base64 my-svc-account-gcp.json)
#export GCP_CI_SVC_ACCOUNT_ID=my-svc-account-gcp-id@....google.com
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
export CI_DOMAIN="ci.domain.tld"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gene1wood
gene1wood / find_admin_teams_of_repos_for_user.py
Created February 6, 2018 22:53
For a given user, identify all repos in a given org for which that user has admin rights, then report the shortest list of team names of teams which are also administrative for those repos.
#!/usr/bin/env python
# This uses pagination functionality not yet present in master of agithub
import agithub.GitHub
import json
from pprint import pprint
def persist_to_file(file_name):
def decorator(original_func):
@bookshelfdave
bookshelfdave / block-aws.py
Last active January 22, 2018 18:09
AWS block script for K8s
from kubernetes import client, config
WHITELISTED_NAMESPACES = ['kube-system']
AWS_NETWORK_POLICY_NAME = 'block-aws'
config.load_kube_config()
v1 = client.CoreV1Api()
v1beta1 = client.ExtensionsV1beta1Api()
networkingv1 = client.NetworkingV1Api()