Skip to content

Instantly share code, notes, and snippets.

View jonico's full-sized avatar
🪐
@ home

Johannes Nicolai jonico

🪐
@ home
View GitHub Profile
@mikebway
mikebway / RemoveGitHubPackages.md
Last active January 6, 2020 14:09
Removing GitHub Packages with GraphQL

Using GraphQL to Remove GitHub Packages

This is easily done with GraphiQL installed as an application on your laptop but any tool that allows HTTP headers to be easily configured will work.

NOTE: You Remove Package Versions not Packages Themselves

GitHub provides no mechanism (at the time of writing) to remove packages as such, but removing all of the versions of a package has the equivalent effect. You may have to repeat the delete package version operation many times but in the end, the package will be gone and consume no more of your package space allocation.

@skwid138
skwid138 / accept-github-invites.sh
Last active June 23, 2020 15:35
Accept all invitations to collaborate on Github
#!/bin/bash
# must install JQ
# https://stedolan.github.io/jq/download/
# on OSX brew install jq
# must set Github Personal Access Token with full repo access only
### Set named arguments -t
while getopts ":t:" opt; do
@tcbyrd
tcbyrd / SCIM-SAML-Identities.graphql
Last active April 30, 2021 16:42
SCIM and SAML identities for all members in an Organization
# Pass the URL for an Organization into the query
# to get a list of members in a specific Organization.
# Example: { "url": "https://github.com/:organization" }
query getResource($url: URI!) {
resource(url: $url) {
... on Organization {
samlIdentityProvider {
externalIdentities(first:10) {
nodes {
scimIdentity {
@martinda
martinda / git-merge-before-build.dsl
Created April 6, 2016 23:40
Jenkins Pipeline DSL code to demonstrate git merge before build
// Jenkins Pipeline DSL to demonstrate git merge before build
node {
String path = '/tmp/jenkins/upstream-repo'
sh "rm -rf ${path}"
ws(path) {
sh 'git --version'
sh 'git init'
sh 'touch README.md; git add README.md; git commit -m "init"'
sh 'git checkout -b pull-requests/1/from'
sh 'touch file.txt; git add file.txt; git commit -m "Add file"'
@jonico
jonico / index.js
Last active September 20, 2022 11:44
How to debug PlanetScale database-js API with a proxy hooked into node-js 18's fetch API (based on undici)
import { connect } from '@planetscale/database'
import dotenv from 'dotenv'
import express from 'express'
import { ProxyAgent } from 'undici';
const agent = new ProxyAgent('http://localhost:5555');
global[Symbol.for('undici.globalDispatcher.1')] = agent;
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
@markjaquith
markjaquith / gist:2628225
Last active March 29, 2023 23:30
Script to sync WordPress SVN to GitHub
#!/bin/bash
# cd into the directory
cd ~/gitsync/github-wordpress-sync/;
# Make sure we are not already running
if [ -f .sync-running ];then
if test ! `find ".sync-running" -mmin +10`;then
# Currently running, but not stuck
exit 1;
fi
fi;
@lotharschulz
lotharschulz / PublishingArtifactsWithAWSCodeartifactAndGitHubPackages.md
Last active May 22, 2023 07:41
How to publish software artifacts with AWS Codeartifact and GitHub Packages
@jonico
jonico / .env
Last active June 1, 2023 09:04
How to run PlanetScale alongside with an MySQL enabled app that does not have any other internet access
PLANETSCALE_DB=brandnewdb
PLANETSCALE_BRANCH=mybranch
PLANETSCALE_ORG=jonico
PLANETSCALE_SERVICE_TOKEN=pscale_tkn_loCzIH7NktDK-GWJ71eX97Qr5D3a9iEO_pgHCSHUtw
PLANETSCALE_SERVICE_TOKEN_NAME=69xrlIwgs4ms
@sindresorhus
sindresorhus / .profile
Created April 6, 2016 11:10 — forked from bmhatfield/.profile
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
@jonico
jonico / MySQLBYOD.py
Last active July 12, 2023 21:20
Copying from one PlanetScale table to another using AWS Glue (and MySQL 8.0 JDBC driver)
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext, SparkConf
from awsglue.context import GlueContext
from awsglue.job import Job
import time
from pyspark.sql.types import StructType, StructField, IntegerType, StringType
sc = SparkContext()