Skip to content

Instantly share code, notes, and snippets.

View deskobj's full-sized avatar

deskobj

View GitHub Profile
@deskobj
deskobj / .REG-runas-REGEDIT_EXPORT.reg
Last active June 7, 2019 10:45
Add "runas" explorer shell menu entry for .reg files
REGEDIT4
; - or - Windows Registry Editor Version 5.00
; Registry files in format REGEDIT4 cannot contain Unicode characters with a code value greater 255.
; Read more: https://stackoverflow.com/questions/36785645
; Invoke as:
; start .REG-runas-REGEDIT_EXPORT.REG
[HKEY_CLASSES_ROOT\regfile\shell\runas\command]
@="regedit \"%1\""
@deskobj
deskobj / GitK-asStandardUser-OnDir.reg
Last active October 14, 2023 12:19
GitK-asStandardUser-OnDir.reg
REGEDIT4
; - or - Windows Registry Editor Version 5.00
; Registry files in format REGEDIT4 cannot contain Unicode characters with a code value greater 255.
; Read more: https://stackoverflow.com/questions/36785645
; One-liner copy:
; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object net.webclient).DownloadFile('https://gist.github.com/deskobj/44b3ef507ef56ef22a2d0b332a4f3e91/raw', "$env:temp\__GitK-asStandardUser-OnDir.reg") ; explorer "$env:temp"
; TODO: make one-liner run.
@deskobj
deskobj / GitGui-InstallTools.sh
Last active August 14, 2023 20:12
Populate the "Tools" menu entry in Git GUI
#!/bin/bash
#
# Copyright (c) 2018 Patryk Szczepankiewicz. All rights reserved.
#
# For more info, see:
# http://blog.desktopobjects.net/2018/06/populate-tools-menu-entry-in-git-gui.html
#
VERBOSE_PRINT_OUT=1
/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},sl
@deskobj
deskobj / waitForKeyElements.js
Created January 24, 2017 22:31 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@deskobj
deskobj / timed.cmd
Last active March 6, 2020 16:51
Desktop Objects: Process execution timing in batch file -- https://p19z.blogspot.com/2011/08/process-execution-timing-in-batch.html
@rem MODULE ..............: timed
@rem AUTHOR ..............: Patryk Szczepankiewicz ( pszczepa [at] gmail [dot] com )
@rem REFERENCES ..........: https://p19z.blogspot.com/2011/08/process-execution-timing-in-batch.html
@rem USAGE ...............: you can use this to wrap a command
@rem
@rem $ >NUL call timed timeout /t 1
@rem $ SET _timediff
@rem
@rem will return:
@rem
@deskobj
deskobj / GetIpFromName.cmd
Last active September 15, 2019 00:27
Desktop Objects: Launch TightVNC using the Computer Name - or - How to Get IP from Computer Name in MS-DOS Batch -- https://p19z.blogspot.com/2009/01/launch-tightvnc-using-computer-name.html
@setlocal
@ping -n 1 %~2 | find "Pinging" > %TEMP%\ADDR_IPv4.txt
@for /F "tokens=2 delims=[]" %%a in (%TEMP%\ADDR_IPv4.txt) do @set ip=%%a
@endlocal & set "%~1=%ip%"
@deskobj
deskobj / install-excerpt.bat
Last active June 7, 2019 10:49
Desktop Objects: One bug in SED.EXE and another in MS-DOS DEL command -- http://p19z.blogspot.com/2013/02/one-bug-in-sedexe-and-another-in-ms-dos.html
:: Disable an option in the test environment
sed --in-place --unbuffered --expression="s/\(HistoryEnabled.*\)true/\1FALSE/gI" Web.config
@deskobj
deskobj / sed4win.cmd
Last active March 6, 2020 17:19
Workaround for "One bug in SED.EXE and another in MS-DOS cmd.exe DEL command" -- https://p19z.blogspot.com/2013/02/sed-and-msdos-bugs.html
@rem MODULE ..............: sed4win
@rem AUTHOR ..............: Patryk Szczepankiewicz ( pszczepa [at] gmail [dot] com )
@rem USAGE ...............: You can use this to wrap your sed.exe executable on windows.
@rem Customize this script by creating a %SED_EXE% environment variables
@rem or by editing the 'DEFAULT_SED_LOCATION' variable in this script.
@rem DESCRIPTION .........: The base script should just be a one-liner such as [see blog post]
@rem BUT BUG: 'sed' creates a temporary file in the working directory
@rem ( see: http://sourceforge.net/p/gnuwin32/bugs/477/ )
@rem WORKAROUND: delete the temporary file by pattern /sed[a-zA-Z0-9]{6}/
@rem ... BUT WARNING: in terms of wildcards, "sed??????" is equivalent to "sed*"