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
public class AESGCMBytes { //AES-GCM Core wrapper class starts here. | |
//auto-properties for internal values store | |
public byte[] tempKey {get; set;} | |
public byte[] tempTag {get; set;} | |
public byte[] cipherText {get; set;} | |
public byte[] tempNonce{get; set;} | |
public string Encrypt(string plainTextinput) { |
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
$roundtrip = (Measure-Command -Expression { | |
$mainXml = Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/Search()?$filter=IsLatestVersion&searchTerm=%27owner%3Aownernamereplacehere%27&targetFramework=%27%27&includePrerelease=false&$skip=0&$top=5&semVerLevel=2.0.0" -UseBasicParsing -Method Get}) | |
[string]$respTime = "$($roundtrip.TotalSeconds) secs"; | |
$mainXml.Content | |
# NOTE: DateTime req. convert from ISO 8601 format by Newtonsoft JSONConvert.DeserializeObject | |
[PSCustomObject[]]$xmlMap = @(); | |
[xml]$XmlInfo = (Get-Content "$($pwd.Path)/xmlfeed_pack.xml"); | |
$XmlInfo.feed.entry | %{ |
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 | |
echo "UserName,Email,FirstName,LastName,Password" > users.csv; | |
for i in $(seq 1 100); | |
do | |
userid=$(uuidgen | sed 's/-//g'); | |
uniqueid=$(echo $userid | head -c 10); | |
echo "$uniqueid,[email protected],FirstName,LastName,$( head -100 /dev/urandom | tr -dc a-zA-Z0-9 | fold -w ${1:-15} | head -1 )" >> users.csv | |
done |
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
//Run in F12 Tools console. | |
javascript:(function() { var s = document.createElement("script"); s.src="<yourCdnScriptUrl>.js";document.getElementsByTagName("head")[0].appendChild(s)})() | |
//Run in Browser bar, F12 Tools console (JQ, AngularJS testing). | |
javascript:(function(e,s){e.src=s;e.onload=function(){jQuery.noConflict();console.log('jQuery injected')};document.head.appendChild(e);})(document.createElement('script'),'https://code.jquery.com/jquery-latest.min.js') | |
javascript:(function(e,s){e.src=s;e.onload=function(){angular.injector(['ng']);console.log('AngularJS injected')};document.head.appendChild(e);})(document.createElement('script'),'https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js') | |
//Facebook external script inject - using <head> tag. | |
(function(d, script) { | |
script = d.createElement('script'); |
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
console.clear();document.removeEventListener('visibilitychange',function(){}); | |
document.addEventListener( 'visibilitychange' , function() { | |
if (document.URL.includes(document.URL.substr("https://stackoverflow.com"))) { | |
console.log('%cDeveloping . . . 👨💻', 'color:#bdecb6; background:#333c43; border-radius:15px; border:5px; border-color:lightgreen; text-shadow:2px; padding:10px'); | |
} | |
if(document.URL != "" && document.URL.substr("https://stackoverflow") != "https://stackoverflow.com") { | |
console.log('%cJust Browsing . . 🌐', 'color:#58777d; font-size:0.98rem; font-weight:bold; font-family:Arial; background:#acbdd3; border-radius:50%;box-shadow: 10px 5px 5px #333c43; text-shadow:10px; padding:65px'); | |
} | |
}, false ); |
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
var filterTable = (function () { //start IIFE .. | |
return { //filtering parts.. | |
addFilterTextBoxes: function() { | |
/* IIFE to activate filtering on keypress textboxes on jQuery DataTables columns */ | |
var api = this.api(); | |
// For each column | |
api |
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
rgb2hex = s => s.match(/[0-9]+/g).reduce((x,y) => x + (y|256).toString(16).slice(1),'0x'); |
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
$elapsedTime = [system.diagnostics.stopwatch]::StartNew() | |
# change value for other timer durations. | |
1..2000 | %{write-progress -activity "Working..." -status "$([string]::Format("Time Elapsed: {0:d2}:{1:d2}:{2:d2}", $elapsedTime.Elapsed.hours, $elapsedTime.Elapsed.minutes, $elapsedTime.Elapsed.seconds))" -percentcomplete ($_/10);} | |
$elapsedTime.stop() |
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
<# | |
# | |
# Initial login flow for website image to be generated | |
# ->Open main website | |
# -> Open login form | |
# -> login to website main part, click on a 'specific' button | |
# -> take screenshot of whole website part, logout and close browser window. | |
# | |
# NOTE: screenshot is watermarked with a timestamp (time/date) and an MD5 digest | |
# |
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
<# | |
# chrome_downgrade.ps1 | |
# | |
# Script used for downgrading current chrome installation to earlier instances (recommended up to v83+). | |
# | |
# Used for renaming current system configuration and sets | |
# appropriate setting for using chrome with older version. | |
# | |
# WARNING: This script also will disable any future updates on chrome | |
# so that the downgraded version is locked to the latest installation. |
NewerOlder