Skip to content

Instantly share code, notes, and snippets.

@jimbrig
jimbrig / README.md
Created October 9, 2024 15:21
Docker Logins (Docker Hub, GitHub, GCP, Azure, AWS)
@jimbrig
jimbrig / openapi.yml
Created October 8, 2024 01:19
OpenAPI Security Scheme Examples
components:
securitySchemes:
# apiKey ------------
auth1:
description: Recommended authenticator
type: apiKey
in: query
name: key
auth2:
@jimbrig
jimbrig / titleUrlMarkdownClip.js
Created September 27, 2024 01:40 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@jimbrig
jimbrig / gist:eaf97bac73e9056c55d12a9023df2a4c
Created September 27, 2024 01:38 — forked from asabaylus/gist:3071099
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@jimbrig
jimbrig / convertImgToBase64.js
Created September 25, 2024 20:56 — forked from MarkoCen/convertImgToBase64.js
Read Image (PNG/JPEG) From Disk and Convert it to base64-encoded string on Node Server
import fs from 'fs';
import path from 'path';
const convert = (imgPath) => {
// read image file
fs.readFile(imgPath, (err, data)=>{
// error handle
if(err) {
throw err;
}
@jimbrig
jimbrig / bookmarkleting.md
Created September 25, 2024 19:45 — forked from caseywatts/bookmarkleting.md
Making Bookmarklets

This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Making Bookmarklets

I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!

A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.

@jimbrig
jimbrig / .exec-shiny-app.R
Created September 24, 2024 00:06 — forked from dancingfrog/.exec-shiny-app.R
.exec-shiny-app.R
#!/usr/bin/env Rscript
# Title : Execute Shiny App
# Objective : Initialize Plumber and run Shiny app as "future" (background) worker as defined by local app.R or server.R/ui.R
# Created by: John Hall
library("future")
library("httr")
library("httpuv")
library("magrittr")
library("plumber")
library("shiny")
@jimbrig
jimbrig / jq-cheetsheet.md
Created September 21, 2024 00:05 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

{
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "properties.getProperties.response",
"title": "getProperties response schema",
"description": "Schema for getProperties response",
"type": "object",
"required": [
"response"
],
"properties": {
@jimbrig
jimbrig / ChatTTY.ps1
Created September 15, 2024 22:57 — forked from ShaunLawrie/ChatTTY.ps1
ChatTTY - A wireframe of a chat app in PwshSpectreConsole
#Requires -Modules @{ ModuleName = 'PwshSpectreConsole'; RequiredVersion = '2.1.1' }
Set-SpectreColors -AccentColor DeepPink1
# Build root layout scaffolding for:
# .--------------------------------.
# | Title | <- Update-TitleComponent will render the title
# |--------------------------------|
# | | <- Update-MessageListComponent will display the list of messages here
# | |