Skip to content

Instantly share code, notes, and snippets.

@MiggieNRG
MiggieNRG / c++output.tmLanguage
Created January 1, 2022 16:23
A c++ build system of Sublime Text 3 for contest programming. This would open up the compiled exe in a CMD automatically! Also this includes a custom c++ output error message highlighter.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>ssraw</string>
</array>
<key>name</key>
<string>Mazanin</string>
@MiggieNRG
MiggieNRG / styles.less
Created January 1, 2022 16:35
Operator Mono and Fira Code working together in Atom
// ...
atom-workspace,
atom-text-editor {
font-family: "Fira Code";
text-rendering: optimizeLegibility;
font-size: 17px;
font-weight: 400;
line-height: 1.8;

Keybase proof

I hereby claim:

  • I am miggienrg on github.
  • I am djmiggie (https://keybase.io/djmiggie) on keybase.
  • I have a public key ASCY3x7xpgw-u8zw1JvyVyCZMsh6UmGI2zDpzFiPHA2V4Qo

To claim this, I am signing this object:

@MiggieNRG
MiggieNRG / hello.js
Created January 2, 2022 00:57
Repro property set before custom element upgrade
customElements.define('hello-world', class extends HTMLElement {
constructor() {
super()
this.innerHTML = '<div>Hello world!</div>'
}
set mode (mode) {
this.querySelector('div')
.setAttribute('style', mode === 'light'
? 'background: white; color: black;'
@MiggieNRG
MiggieNRG / GetWindowsProductKey.vbs
Created January 2, 2022 07:35
Retrieve Windows Product Key
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
@MiggieNRG
MiggieNRG / hello.csv
Last active January 2, 2022 08:36
hello.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
language,code
Language ▼,
1C-Enterprise,"// Hello World in 1C:Enterprise built-in script language
Message(""Hello, World!"");"
4Test,"// Hello World in 4Test
testcase printHelloWorld()
print(""Hello World!"")"
ABAP4,"REPORT ZHB00001.
@MiggieNRG
MiggieNRG / get-admin.bat
Created January 2, 2022 09:14
Sample batch to run itself elevated
@echo off
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
@MiggieNRG
MiggieNRG / GetLocalAdmins.yaml
Created January 2, 2022 09:19
Get All Local Admins
name: Custom.GetLocalAdmins
description: |
Gets a list of local admin accounts
reference:
- https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/get-localgroupmember?view=powershell-5.1
# Can be CLIENT, CLIENT_EVENT, SERVER, SERVER_EVENT
type: CLIENT
@MiggieNRG
MiggieNRG / Get-LocalAdmins.ps1
Created January 2, 2022 09:24
Get-LocalAdministrators
function Get-LocalAdministrators {
param ([string]$computername=$env:computername,
[System.Management.Automation.CredentialAttribute()]$Credential
)
$computername = $computername.toupper()
$ADMINS = get-wmiobject -computername $computername -Credential $Credential -query "select * from win32_groupuser where GroupComponent=""Win32_Group.Domain='$computername',Name='administrators'""" | % {$_.partcomponent}
foreach ($ADMIN in $ADMINS) {
$admin = $admin.replace("\\$computername\root\cimv2:Win32_UserAccount.Domain=","") # trims the results for a user