Skip to content

Instantly share code, notes, and snippets.

View jghankins's full-sized avatar
🏠
Working from home

Jim Hankins jghankins

🏠
Working from home
View GitHub Profile
@jghankins
jghankins / toggle-menu-bar.js
Created July 9, 2025 11:51
Toggle Menu Bar
#!/usr/bin/env node
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Toggle Menu Bar
// @raycast.mode compact
// @raycast.packageName System
// Optional parameters:
// @raycast.icon 🔄
@jghankins
jghankins / simple_s3_upload.ex
Created June 6, 2025 00:45 — forked from plicjo/simple_s3_upload.ex
LiveView Uploads to S3
defmodule SimpleS3Upload do
@moduledoc """
Dependency-free S3 Form Upload using HTTP POST sigv4
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html
"""
@doc """
Signs a form upload.
The configuration is a map which must contain the following keys:
* `:region` - The AWS region, such as "us-east-1"
@jghankins
jghankins / CountryCodes.json
Created December 28, 2023 15:19 — forked from anubhavshrimal/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@jghankins
jghankins / widget.cpp
Created September 28, 2019 11:36
double click slot
#include "widget.h"
#include "ui_widget.h"
#include "CaptureItemDelegate.h"
#include <QDebug>
#include <QStandardItemModel>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
@jghankins
jghankins / deleteJenkinsJobs
Created August 5, 2019 01:17
Delete Jenkins Jobs
def jobName = "copy_folder"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()
@jghankins
jghankins / iterm
Last active September 10, 2019 09:56 — forked from vyder/iterm
iterm.bash - Launch iTerm from command line
#!/bin/zsh
#
# Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+
# This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open.
# TODO Add option to close iTerm2 after cmd execs
# See also https://www.iterm2.com/documentation-scripting.html
#
# Usage:
# iterm Opens the current directory in a new iTerm window
# iterm [PATH] Open PATH in a new iTerm window
@jghankins
jghankins / flushKeychain.sh
Created October 23, 2017 18:07
Flush OSX Keychain for Docker when using AWS ECR.
#!/usr/bin/env bash
#Look in Mac Keychain for AWS account key and delete if found as credentials are time limited
if security find-internet-password -a AWS; then
security delete-internet-password -a AWS
fi
@jghankins
jghankins / BuildDockerfile.groovy
Created October 23, 2017 18:05
Build Dockerfile and flush cache for ECR if Mac and login to ECR
String template = new File("${project.basedir}/src/main/docker/DockerfileTemplate".toString()).getText()
def dockerFileText = new groovy.text.SimpleTemplateEngine().createTemplate(template)
.make([fileName: project.build.finalName])
println "writing dir " + "${project.basedir}/target/dockerfile"
new File("${project.basedir}/target/dockerfile/".toString()).mkdirs()
println "writing file"
File dockerFile = new File("${project.basedir}/target/dockerfile/Dockerfile".toString())
repeat
set account to "AWS"
try
do shell script "security find-internet-password -a " & account
do shell script "security delete-internet-password -a " & account
log "Password deleted"
on error errStr number errorNumber
log "Password does not exist"
end try
delay 600
@jghankins
jghankins / zuul.yml
Created October 6, 2017 04:25
Zuul Config Properties from Config Server
#zuul proxy server
---
spring:
profiles: prod
server:
port: 8080
zuul:
routes:
dashboard: