Skip to content

Instantly share code, notes, and snippets.

View t1m0thyj's full-sized avatar

Timothy Johnson t1m0thyj

  • Pittsburgh, PA
  • 15:29 (UTC -04:00)
View GitHub Profile
@(
'7zip'
'coretemp'
'fiddler'
'filezilla'
'firacode-ttf'
'firefox'
'gh'
'git'
'grepwin'
"""zowe_dl.py - Download all data sets matched by a wildcard
Usage: zowe_dl.py <dsname-wildcard> [zowe-args]
Examples:
zowe_dl.py HLQ.* --zosmf-p PROFILE
zowe_dl.py HLQ.* --host HOST --port PORT --user USER --password PASSWORD --no-ru
"""
import json
import requests
import subprocess
GITHUB_API = "https://api.github.com"
GITHUB_PAT = "<personal-access-token>"
OLD_USER = "<username>"
NEW_USER = "<username>"
gists = requests.get(GITHUB_API + "/users/" + OLD_USER + "/gists").json()
for gist in gists:
apiVersion: v2
publisher: broadcommfd
name: jcl-language-support
version: latest
type: VS Code extension
displayName: JCL Language Support
title: JCL Language Support
description: JCL support for VSCode
# icon: https://open-vsx.org/api/BroadcomMFD/jcl-language-support/1.0.0/file/logo.png
repository: https://github.com/BroadcomMFD/jcl-language-support
const keytar = require("keytar");
const SERVICE = require("os").userInfo().username;
const ACCOUNT = "VeryLongValue";
async function testCred(length) {
const secret = '*'.repeat(length);
try {
await keytar.setPassword(SERVICE, ACCOUNT, secret);
} catch {
return false;
@t1m0thyj
t1m0thyj / 24hr-Clock.ino
Last active May 11, 2022 10:59
24hr Clock - requires Arduino Uno, ESP8266 ESP-01 Wi-Fi module, and Scroll pHAT HD
#include <Adafruit_IS31FL3731.h>
#include <ezTime.h>
#include <WiFiEsp.h>
#include "arduino_secrets.h"
// Emulate Serial1 on pins 6/7 if not present
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif
@t1m0thyj
t1m0thyj / 01.py
Last active December 16, 2020 01:36
Advent of Code 2020
from itertools import combinations
with open("01.txt", 'r') as f:
nums = [int(line.rstrip()) for line in f]
# 1a
print(next(a * b for a, b in combinations(nums, 2) if a + b == 2020))
# 1b
for a, b, c in combinations(nums, 3):
@echo off
SET DIR=%temp%
::download install.ps1
%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "((new-object net.webclient).DownloadFile('https://chocolatey.org/install.ps1','%DIR%install.ps1'))"
::run installer
%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%DIR%install.ps1' %*"
call C:\ProgramData\chocolatey\bin\RefreshEnv.cmd
@t1m0thyj
t1m0thyj / choco.wsb
Last active January 8, 2024 20:23
Windows Sandbox config that installs Chocolatey and mounts Public Documents to Desktop
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Users\Public\Documents\</HostFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -Command "start powershell { -NoExit -Command \"&amp; { Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyInstaller.psm1"; Update-SessionEnvironment; cd C:\Users\WDAGUtilityAccount }\" }"</Command>
</LogonCommand>