Skip to content

Instantly share code, notes, and snippets.

View nullobject's full-sized avatar

Joshua Bassett nullobject

View GitHub Profile
# Foundation Target (install system runtime deps)
FROM xyz:1.0@sha256:abcd1234 AS foundation
# Runtime deps and common environment stuff here
# Build Target (install system buildtime deps)
FROM foundation AS build
# Install build-time systems deps and things here, we don’t want/need these in production
# Development Target (development toolchain)
FROM build AS development
@zero-master
zero-master / ClickLogConsumer.java
Created April 18, 2018 11:09
Write from Cloud Pub/Sub to BigQuery using Fileload and save cost on streaming inserts!
package ...
import com.google.api.services.bigquery.model.TableFieldSchema;
import com.google.api.services.bigquery.model.TableRow;
import com.google.api.services.bigquery.model.TableSchema;
import com.google.api.services.bigquery.model.TimePartitioning;
import com.google.common.collect.ImmutableList;
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO;
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active May 13, 2024 01:55
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@ghoranyi
ghoranyi / AWS Swarm cluster.md
Last active May 31, 2021 05:28
Create a Docker 1.12 Swarm cluster on AWS

This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.

Prerequisites

You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.

$ docker --version
Docker version 1.12.0, build 8eab29e

You also need Docker machine installed.

@TomWhitwell
TomWhitwell / clouds.cc
Last active December 19, 2021 06:27
"Hello World' for Mutable Instruments Clouds module
// Copyright 2014 Olivier Gillet.
//
// Author: Olivier Gillet (ol.gillet@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@bmhatfield
bmhatfield / .profile
Last active June 18, 2024 09:38
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@mambroziak
mambroziak / awsEc2MetadataShortcuts.sh
Last active November 1, 2023 22:34
AWS EC2 Instance Metadata to BASH Script Variables
#!/bin/bash
# JQ is required to more easily parse json.
AWS_IAM_ROLE=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/`
AWS_ACCESS_KEY_ID=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.AccessKeyId'`
AWS_SECRET_ACCESS_KEY=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.SecretAccessKey'`
AWS_TOKEN=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.Token'`
AWS_AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
AWS_DEFAULT_REGION="`echo \"$AWS_AZ\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
LOCAL_IP=`curl -sL http://169.254.169.254/latest/meta-data/local-ipv4`
PUBLIC_IP=`curl -sL http://169.254.169.254/latest/meta-data/public-ipv4`
@edsko
edsko / callbacks.hs
Last active January 14, 2019 06:43
Alleviating callback hell in Haskell
{-------------------------------------------------------------------------------
Discussion of ContT in terms of callbacks
For an alternative exposition, see
<http://www.haskellforall.com/2012/12/the-continuation-monad.html>.
-------------------------------------------------------------------------------}
{-# OPTIONS_GHC -Wall #-}
import Control.Exception
@phrawzty
phrawzty / 2serv.py
Last active July 24, 2024 03:54
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@koistya
koistya / React-Directory-Layout.md
Last active April 7, 2024 19:01
File and folder naming convention for React.js components

File and folder naming convention for React.js components

Directory Layout #1

/actions/...
/components/common/Link.js
/components/common/...
/components/forms/TextBox.js
/components/forms/TextBox.res/style.css