Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jonguenther
jonguenther / ajax.html
Created January 20, 2018 19:35
Send an Ajax request to an API using Jquery
<?php
?>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Import jquery and Ajax script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="ajax.js"></script>
@jonguenther
jonguenther / pastebin.sh
Created June 22, 2018 09:48 — forked from ktmud/pastebin.sh
Pastebin Bash Script.
#!/bin/bash
# Paste at Pastebin.com using command line (browsers are slow, right?)
# coder : Anil Dewani
# date : Novemeber 7, 2010
#help function
howto()
{
echo "\
Pastebin.com Bash Script \
@jonguenther
jonguenther / collection_uno.js
Last active September 24, 2020 08:26
Jon's Javascript collection
// get array of unique keys in array of objects
const getUniqueKeys = (ArrayOfObjects) => new Set(ArrayOfObjects.reduce((acc, cur) => [...acc, ...Object.keys(cur)], []));
// conditional properties inside objects
const fooCondition = false;
const conditionalObject = {
someProperty: 'foo',
...(fooCondition && { bar: true }),
anotherProperty: 'bar',
@jonguenther
jonguenther / pastebin.sh
Last active February 15, 2022 03:46 — forked from ktmud/pastebin.sh
Bash Script to upload files and data to Pastebin.com
#!/bin/sh
# Paste at Pastebin.com using command line (browsers are slow, right?)
# coder : Anil Dewani
# date : Novemeber 7, 2010
# revised on June 22, 2018 by Jonathan Guenther
# see README for more information (if I have time to create one...)
echo +--------------------------------------------+
@jonguenther
jonguenther / deleteRuns.sh
Created February 28, 2024 10:30
Delete Github Actions Workflows
#!/bin/bash
# This script uses the gh cli to delete all workflows in a repo
# Useful if you want to regularly clean up your workflows (e.g. to free up some shared storage)
# based on https://github.com/orgs/community/discussions/77039#discussioncomment-7685341
# the gh cli only allows to delete 20 workflows at a time, so we wrap it in a loop
# and set the exit condition to when no more workflows are available
while true; do
# Fetch the list of workflow runs and extract the databaseId using jq