Skip to content

Instantly share code, notes, and snippets.

View example.sarif.json
{
"version": "2.1.0",
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"runs": [
{
"tool": {
"driver": {
"name": "Brakeman",
"informationUri": "https://brakemanscanner.org",
"semanticVersion": "4.10.0",
View webinar-playbook-for-live-demos.md

About

This 🚧 work-in-progress 🚧 playbook for developing and delivering webinar content, with a focus on delivering live demos...

📚 Playbook

  1. I develop the narrative, e.g. as a high-level outline, using the team as a sounding board to get feedback / inputs early on!
  2. I try and write the least amount of code possible in the amount of time available! I can always fake it, e.g. I just started building this app, the important part is the narrative.
  3. Pre-recorded demos are great, they buy predictability but at the cost of prolonged preparation time, and they allow me to speed up boring parts, like waiting for builds to complete.
  4. My preference is to use ScreenFlow to screen-record my demos.
@swinton
swinton / README.md
Created Dec 3, 2020
Using GitHub's Git data API
View README.md

Using GitHub's Git data API by Example

  1. Create a blob
  2. Create a tree
  3. Create a commit
  4. Create (or update) a ref

Create a blob

@swinton
swinton / README.md
Last active Dec 3, 2020
Automatically sign your commits from GitHub Actions, using the REST API
View README.md

Verified commits made easy with GitHub Actions

image

So you want to commit changes generated by a GitHub Actions workflow back to your repo, and have that commit signed automatically?

Here's one way this is possible, using the REST API, the auto-generated GITHUB_TOKEN, and the GitHub CLI, gh, which is pre-installed on GitHub's hosted Actions runners.

You don't have to configure the git client, just add a step like the one below... Be sure to edit FILE_TO_COMMIT and DESTINATION_BRANCH to suit your needs.

@swinton
swinton / CODE.md
Created Nov 28, 2020
How to Enable Pasting Text on Sites That Block It
View CODE.md

Re-enable copy and paste

var allowEvent = function(e) {
  e.stopImmediatePropagation();
  return true;
};
document.addEventListener('paste', allowEvent, true);
document.addEventListener('copy', allowEvent, true);
@swinton
swinton / IssueTimelineItemsConnection.graphql
Created Nov 13, 2020
GraphQL | IssueTimelineItemsConnection usage
View IssueTimelineItemsConnection.graphql
{
resource(url: "https://github.com/microsoft/vscode/issues/10121") {
... on Issue {
url
title
timelineItems(first: 50, itemTypes: [CROSS_REFERENCED_EVENT]) {
edges {
node {
... on CrossReferencedEvent {
source {
@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",