Skip to content

Instantly share code, notes, and snippets.

View quantumJLBass's full-sized avatar

Quantum quantumJLBass

View GitHub Profile
@quantumJLBass
quantumJLBass / Clueless, 1995
Last active September 10, 2024 21:59
SQL stuff
As if!
@quantumJLBass
quantumJLBass / contacted_bcc_email_001.csv
Last active March 16, 2024 03:28
contactlist_embeded
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 1 in line 1.
@quantumJLBass
quantumJLBass / gitreplace <file_path>
Created January 7, 2024 06:31
quick chat code - p1
![User](https://s.gravatar.com/avatar/79f1f829fd9bc1b63c4c2555d503c4f6?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fqu.png)
You
how to make a command to run from a windows terminal with powershell core 7.x so that I can do \`gitreplace <file\_path>\` and it have it go to the file and ultimately be running something like \` curl -L -o "ROADMAP.md" "https://raw.githubusercontent.com/{user}/{repo}/{branch}/ROADMAP.md"\` where the values for \`{user}\` and so on, are discern from git or the folders and file directly around the file(ie: the repo the file belongs to). I am surprised this is not already baked in .. is there an already done solution out there ? other ways please proceed
ChatGPT
ChatGPT
@quantumJLBass
quantumJLBass / logbackup-oneliner.ps1
Created December 19, 2023 07:50
powershell system auditing bk, self zipping and logs it's self too
& { param($excludeLogs) $d = Get-Date -Format "yyyy-MM-dd-HH-mm"; $zipPath = "D:\_audit\logs\Foo-$d.zip"; $errorLog = "D:\_audit\logs\ErrorLog-$d.txt"; $logDir = "D:\_audit\logs\Foo-$d"; $null = New-Item -ItemType Directory -Force -Path $logDir; $counter = 0; $total = (wevtutil.exe el).Count; wevtutil.exe el | ForEach-Object { $counter++; if ($Host.UI.RawUI) { Write-Progress -Activity "Processing Event Logs" -Status "$_ Processing" -PercentComplete (($counter / $total) * 100); } $time = Measure-Command { if ($_ -notin $excludeLogs) { try { $log = Get-WinEvent -LogName $_ -MaxEvents 1 -Oldest -ErrorAction SilentlyContinue; } catch { $_ >> $errorLog; continue } if ($log) { $logPath = "$logDir\$d-$($_.Replace('/', '-'))-bk.evtx"; Remove-Item -Path $logPath -ErrorAction SilentlyContinue; try { $exportResult = wevtutil.exe epl "$_" $logPath 2>&1; if ($LASTEXITCODE -eq 0) { try { Compress-Archive -Path $logPath -DestinationPath $zipPath -Update -CompressionLevel Optimal; } catch { $_ >> $errorLog; continue }; try
@quantumJLBass
quantumJLBass / ZipDir.ps1
Created July 29, 2023 20:26
Zip up a directory per a .gitignore file in PS1
function Get-ZipFiles {
param (
[string]$Path = (Get-Location),
[string]$GitIgnorePath = (Join-Path -Path (Get-Location) -ChildPath ".gitignore")
)
# Read .gitignore file
$gitIgnorePatterns = Get-Content -Path $GitIgnorePath | Where-Object {
@quantumJLBass
quantumJLBass / cloudSettings
Last active January 31, 2020 12:56
RAWdeal-VSC-settings
{"lastUpload":"2020-01-08T10:54:06.695Z","extensionVersion":"v3.4.3"}
var values = new[]
{
new[] { 1, 2 },
new[] { 2, 3 },
new[] { 4, 5 },
};
var flattenedUniqueValues = values.SelectMany(x => x).Distinct();//technically it handles none int too
(function( window, $, WSU ){
WSU.time = null;
WSU.timer = function( time, callback){
console.log("clear old timer");
window.clearTimeout(WSU.time);
WSU.time = null;
console.log("set timer");
WSU.time = window.setInterval(function(){
console.log("do timer callback");
if( "function" === typeof callback){
@quantumJLBass
quantumJLBass / Taxonomy.md
Last active December 4, 2015 21:16
Dev version (note product is repo.wsu.edu/jtrack/1/bootstrap/bootstrap.min.js and also use Google's analytics debugger to confirm function or contact **jeremy.bass at wsu.edu** for help ) ~~~ defaults listed here https://github.com/washingtonstateuniversity/jTrack/blob/dev/src/bootstrap/src/bootstrap.js#L84 ~~~

Taxonomy

This is a list of the name and values for the units by unit type.

NAME ( human readable ) VALUE ( to store in databases or use in code ) Historical names, Common names, Acronyms ( CSV initially and may be used to look up the value )
[alias]
pushdoc = "!f(){ git add -A; git commit -m ${0} && git push; };f"