Skip to content

Instantly share code, notes, and snippets.

:octocat:

Steve Winton swinton

:octocat:
View GitHub Profile
@swinton
swinton / serve.sh
Created Jul 22, 2020
Run a local web server with Python
View serve.sh
#!/bin/bash
# enable job control
set -m
port="${1:-8000}";
# start server, in background
python -m http.server $port &
@swinton
swinton / macos-defaults
Created Apr 3, 2020
defaults read -g | pbcopy
View macos-defaults
{
AKDeviceUnlockState = 0;
AKLastCheckInAttemptDate = "2020-04-03 14:54:49 +0000";
AKLastCheckInSuccessDate = "2020-04-03 14:54:51 +0000";
AKLastEmailListRequestDateKey = "2020-03-03 16:56:46 +0000";
AKLastIDMSEnvironment = 0;
"Apparent Doxie Go" = 1;
"Apple Inc. Apple Mobile Device (Recovery Mode)" = 1;
"Apple Inc. Apple TV Remote" = 1;
"Apple Inc. Magic Trackpad 2" = 1;
View pull_request-event-payload.json
{
"event": "pull_request",
"payload": {
"action": "synchronize",
"number": 1,
"pull_request": {
"url": "https://api.github.com/repos/swinton/Spoon-Knife/pulls/1",
"id": 380337778,
"node_id": "MDExOlB1bGxSZXF1ZXN0MzgwMzM3Nzc4",
"html_url": "https://github.com/swinton/Spoon-Knife/pull/1",
View push-event-payload.json
{
"event": "push",
"payload": {
"ref": "refs/heads/some-branch",
"before": "a23a73088bb8d69c89abcfece9a91d4e539aed7e",
"after": "52f7e61280c44756691959a11e6970bf153c8ba6",
"repository": {
"id": 243290722,
"node_id": "MDEwOlJlcG9zaXRvcnkyNDMyOTA3MjI=",
"name": "Spoon-Knife",
@swinton
swinton / self-hosted-runners-playground.md
Created Feb 25, 2020
Programmatically create a self-hosted runner
View self-hosted-runners-playground.md
View eksctl-policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:CreateInstanceProfile",
"iam:DeleteInstanceProfile",
"iam:GetRole",
"iam:GetInstanceProfile",
@swinton
swinton / prepare-release-branch.yml
Last active Oct 30, 2019
Sync release branch with master on every push to master, and include productionized node_modules folder on release
View prepare-release-branch.yml
name: Prepare Release Branch
on:
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master
jobs:
prepare-release-branch:
name: Prepare Release Branch
View deploy-to-eks.yml
# eks.yml
on:
pull_request:
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master
name: Build and Deploy to EKS
env:
View quickstart.js
const fs = require('fs');
const readline = require('readline');
const {google} = require('googleapis');
// If modifying these scopes, delete credentials.json.
const SCOPES = ['https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.send'];
const TOKEN_PATH = 'credentials.json';
// Load client secrets from a local file.
fs.readFile('client_secret.json', (err, content) => {
You can’t perform that action at this time.