Skip to content

Instantly share code, notes, and snippets.

View April-June-August's full-sized avatar
💭
Learning how to use a keyboard.

May-June-July April-June-August

💭
Learning how to use a keyboard.
View GitHub Profile
@SKaplanOfficial
SKaplanOfficial / now-playing.js
Last active June 16, 2025 15:39
AppleScript and JXA scripts to get Now Playing info. Works on macOS 15.4+, including macOS 26 beta 1.
function run() {
const MediaRemote = $.NSBundle.bundleWithPath('/System/Library/PrivateFrameworks/MediaRemote.framework/');
MediaRemote.load
const MRNowPlayingRequest = $.NSClassFromString('MRNowPlayingRequest');
const appName = MRNowPlayingRequest.localNowPlayingPlayerPath.client.displayName;
const infoDict = MRNowPlayingRequest.localNowPlayingItem.nowPlayingInfo;
const title = infoDict.valueForKey('kMRMediaRemoteNowPlayingInfoTitle');

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

@stephancasas
stephancasas / straycat.sh
Last active March 15, 2025 09:23
straycat.sh — a minimal HTTP server script for netcat.
#!/bin/sh
# ------------------------------------------------------------------------------
# Straycat.sh HTTP Server (straycat)
# ------------------------------------------------------------------------------
#
# Author:
# Stephan Casas <[email protected]>
#
# Description:
@SoraAzure
SoraAzure / airdropSorter.scpt
Last active March 12, 2023 12:21 — forked from menushka/airdropSorter.scpt
Avoid overwriting files with the same name in the target folder by appending a number suffix.
property destinationFolder : "Path:to:AirDrop:Folder:in:Alias:format" -- Please change this
property quarantineTypes : { "59" }
on run {input, parameters}
tell application "Finder"
set filesToMove to {}
repeat with iInput from 1 to count input
set filePath to item iInput of input
set shouldProcess to false
if (count quarantineTypes) > 0 then
@menushka
menushka / airdropSorter.scpt
Created December 30, 2018 22:47
A Folder Action script written in AppleScript used to separate AirDropped files into a different folder other than the default Downloads folder
property AIRDROP_FOLDER : "Path:to:AirDrop:Folder:in:Alias:format"
property QUARANTINE_KEY : "59"
property GET_QUARANTINE_COMMAND_START : "ls -l -@ '"
property GET_QUARANTINE_COMMAND_END : "' | tr '\\n' ' ' | sed 's/.*com\\.apple\\.quarantine\\s*\\(\\d*\\)/ \\1/' | awk '{$1=$1};1'"
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to length of added_items
set current_item to item i of added_items
set quarantine_type to getQuarantineType(POSIX path of current_item)
@ytakano
ytakano / epubVertical.sh
Last active December 28, 2024 17:34
横書きのepubファイルを縦書きに変更するスクリプト
#!/usr/bin/env sh
if [ $# -ne 1 ]; then
echo "need epub file!" 1>&2
echo "example:" 1>&2
echo " $ $0 ebook.epub" 1>&2
exit 1
fi
FILE=`basename "$1" .epub`
@JMichaelTX
JMichaelTX / JXA Resources.md
Last active May 25, 2025 11:13
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber:
@lotem
lotem / rime_deployer
Created April 26, 2013 03:22
使用 Squirrel 自帶的命令行工具 rime_dict_manager 和 rime_deployer
#!/bin/bash
#
# put this script in ~/Library/Rime, then deploy Rime for Squirrel:
# ./rime_deployer --build . "/Library/Input Methods/Squirrel.app/SharedSupport/"
# see other supported options:
# ./rime_deployer
DYLD_LIBRARY_PATH="/Library/Input Methods/Squirrel.app/Contents/Frameworks" "/Library/Input Methods/Squirrel.app/Contents/MacOS/rime_deployer" $@
@nozma
nozma / EmacsMode.bas
Created May 5, 2012 15:51
Emacs like key bindings for Microsoft Excel
'' define EmacsMode key bindings
Sub EmacsMode()
With Application
.OnKey "^{f}", "ForwardCell"
.OnKey "^{b}", "BackwardCell"
.OnKey "^{p}", "PreviousLine"
.OnKey "^{n}", "NextLine"
.OnKey "^{a}", "BeginningOfUsedRangeLine"
.OnKey "^{e}", "EndOfUsedRangeLine"
.OnKey "%{<}", "BeginningOfUsedRangeRow"