This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| namespace Calc | |
| { | |
| public class FluentCalculator | |
| { | |
| private static readonly int[] Values = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; | |
| private enum OperatorType |
This file contains hidden or 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
| import time | |
| import sys | |
| import base64 | |
| from seleniumbase import Driver | |
| #import undetected_chromedriver as uc | |
| #from selenium import webdriver | |
| #from selenium.webdriver.chrome.options import Options | |
| from selenium.webdriver.common.by import By | |
| from selenium.webdriver.support.ui import Select |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 Util | |
| { | |
| public static Tuple<string?, string?> GetMemoryAddressOfClass<T1, T2>(T1 o1, T2 o2) | |
| where T1 : class | |
| where T2 : class | |
| { | |
| //using generics to block structs, that would be boxed | |
| //so we would get address of a boxed object, not struct | |
| //works only for objects that do not contain references | |
| // to other objects |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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'); |
NewerOlder