Skip to content

Instantly share code, notes, and snippets.

View jonnypetraglia's full-sized avatar

Jonny Petraglia jonnypetraglia

View GitHub Profile
@jonnypetraglia
jonnypetraglia / Jonny-MergeBranch.ps1
Last active April 11, 2024 19:57
Powershell Scripts
function ExitOnError{
if (-Not $?) { exit 0 }
}
function Jonny-MergeBranch($Target = 'environment/integrate', [Switch]$Push = $false){
$TargetWhatever = ($Target -split '/')[-1]
$CurrentBranch = (git branch --show-current)
$TicketNumber = ($CurrentBranch -split '/')[-1]
git fetch
ExitOnError
$MergeBranchName = "merge/$TargetWhatever/$TicketNumber"
@jonnypetraglia
jonnypetraglia / Install-LatestPackageVersions.ps1
Last active July 31, 2023 17:18
PowerShell script to install latest versions of a package on a certain branch to a target org
param(
[Parameter(Mandatory = $True)]
[string]$BranchName,
[Parameter(Mandatory = $True)]
[string]$TargetOrg
)
$ErrorActionPreference = "Stop"
Import-Module -Force "$PSScriptRoot\Invoke-Sf.psm1"
$PackageNames = Get-PackageNamesInDependencyOrder
LinkFile=%A_Startup%\SetWallpaper.lnk
IfNotExist, %LinkFile%
FileCreateShortcut, %A_ScriptFullPath%, %LinkFile%
if FileExist("C:\Users\%A_Username%\wallpaper.png")
backgroundFile = C:\Users\%A_Username%\wallpaper.png
else
backgroundFile = C:\Users\%A_Username%\wallpaper.jpg
DllCall("SystemParametersInfo", UInt, 0x14, UInt, 0, Str, Trim(backgroundFile), UInt, 1)
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
@jonnypetraglia
jonnypetraglia / expansions.json
Last active July 14, 2020 03:20
SmashupHelper Expansions
{
"Test": ["Github"],
"Core": [
"Aliens",
"Dinosaurs",
"Ninjas",
"Pirates",
"Robots",
"Tricksters",
"Wizards",
@jonnypetraglia
jonnypetraglia / cloudSettings
Last active July 21, 2021 16:39
Salesforce VSCode Settings
{"lastUpload":"2021-07-21T16:39:29.709Z","extensionVersion":"v3.4.3"}
@jonnypetraglia
jonnypetraglia / README.md
Last active July 26, 2019 19:58
Hulu auto-muter for ads

This is a JS function to automatically mute Hulu when an ad comes on, then unmute it when the show comes back. It works a of 7/26/2019.

To create a bookmarklet, create a new bookmark starting with javascript:, then the contents of minified.js.

@jonnypetraglia
jonnypetraglia / omegle.js
Created October 13, 2018 00:56
Javascript to auto-reroll the text chat on Omegle
var secondsToWait = 7;
var secondsWaited = 0;
var introMsg = "Hey";
function check() {
console.log('checking ' + secondsWaited);
var btn = document.getElementsByClassName('disconnectbtn')[0];
if(btn.textContent.includes('New')) {
btn.click();
setTimeout(() => restart(), 1000);
@jonnypetraglia
jonnypetraglia / magic_words.js
Last active August 29, 2015 14:08
Magic Words lets you effortlessly react to "magic" key sequences on your web page.
/* Note! Requires jQuery right now :( */
var MagicWords = {
spoken: [],
data: undefined,
init: function(d) {
MagicWords.data = d;
MagicWords.longest = 0;
for(var i in MagicWords.data) {
@jonnypetraglia
jonnypetraglia / phff.bat
Created April 24, 2014 09:38
Picasa Hidden Folder Finder
@echo off
echo %%%%%%%%%%%%%%Picasa Hidden Folder Finder%%%%%%%%%%%%%%
REM Extremely short simple version is 'findstr /S /I /M /B "hidden" .picasa.ini' from the root folder.
echo.
set drive=%cd:~0,3%
echo Scanning %drive%.....
echo.
set i=1
cd %drive%
SETLOCAL ENABLEDELAYEDEXPANSION