Skip to content

Instantly share code, notes, and snippets.

View indy-singh's full-sized avatar

Indy indy-singh

View GitHub Profile
@indy-singh
indy-singh / Resharper OOP.md
Last active August 24, 2025 21:44
Resharper OOP
$instanceId = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property instanceId;
Copy-Item -Path "REDACTED\DisabledFeatures.csexp" -Destination "$env:APPDATA\JetBrains\ReSharperPlatformVs17\vAny_$instanceId\DisabledFeatures.csexp" -Force -ErrorAction SilentlyContinue;

Our DisabledFeatures.csexp looks like:-

(20:ModuleZoneLocalNames20:IVsOnlyInProcessZone16:IUnityPluginZone19:IPackageCheckerZone23:IVsDebuggerFeaturesZone20:IEntityFrameworkZone21:ILanguageProtobufZone23:ILanguageJavaScriptZone16:ILanguageCssZone21:IDpaVsIntegrationZone17:ISqlLanguagesZone)
$ProgressPreference = 'SilentlyContinue';
Measure-Command {curl.exe -LORJ http://ipv4.download.thinkbroadband.com/2GB.zip}
TotalSeconds : 18.202043
Measure-Command {Invoke-WebRequest http://ipv4.download.thinkbroadband.com/2GB.zip -OutFile .\001.zip}
TotalSeconds : 18.137646
Measure-Command {Start-BitsTransfer -Source http://ipv4.download.thinkbroadband.com/2GB.zip -Destination .\002.zip}
TotalSeconds : 23.4500287
# required to load in the DLLs
[Windows.ApplicationModel.DataTransfer.Clipboard, Windows.ApplicationModel.DataTransfer, ContentType=WindowsRuntime];
# this one doens't seem to work but registers fine
[Windows.ApplicationModel.DataTransfer.Clipboard]::add_ContentChanged({[Console]::Beep()});
# this one does beep
[Windows.ApplicationModel.DataTransfer.Clipboard]::add_HistoryChanged({[Console]::Beep()});
# Used
{
debug # because error driven development is much easier
http_port 8080 # IIS uses port 80, don't conflict with it
auto_https off # this isn't replacing apache, so we don't need this fancy feature
skip_install_trust # this isn't replacing apache, so we don't need this fancy feature
}
# this is a snippet: https://caddyserver.com/docs/caddyfile/concepts#snippets
# it is not a run-time thing! It is a parse-time thing
(base_config) {
SELECT t_minute || ' ' || t_hour || ' ' || t_day_of_month || ' ' || t_month || ' ' || t_day_of_week
FROM generate_series(0,59) t_minute
, generate_series(0,23) t_hour
, generate_series(1,31) t_day_of_month
, generate_series(1,12) t_month
, generate_series(0,6) t_day_of_week;
SELECT count_dracula.count_dracula, substr(order_number::text, 5)::bigint
FROM generate_series(1, 10) count_dracula
LEFT JOIN public.indy_test ON 1 = 1 AND substr(order_number::text, 5)::bigint = count_dracula.count_dracula
WHERE 1 = 1
AND substr(order_number::text, 5)::bigint IS NULL
$result = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Defender\Signature Updates" -Name "SignaturesLastUpdated";
$thing = [System.BitConverter]::ToInt64($result.SignaturesLastUpdated, 0);
[DateTime]::FromFileTime($thing);
curl.exe -LORJ https://haveibeenpwned.com/api/v3/breaches
jq.exe .[] breaches | jq.exe -r .Domain | sort.exe | uniq.exe | awk.exe 'NF' | awk.exe '$0=$0"/.well-known/security.txt"' > urls.txt
xargs -n 1 curl.exe --location --head --max-time 1 -w "%%{http_code} %%{content_type} %%{url}\n" -o NUL -s < urls.txt
from itertools import count
from tqdm import tqdm
import mmh3
from uuid import uuid4
try:
for _ in tqdm(count()):
val = str(uuid4())
h = mmh3.hash(val)
if h == 1228476406:
public static void Main(string[] args)
{
var murmurHash32 = new MurmurHash32();
var dict = new Dictionary<int, List<string>>();
while (true)
{
var s = Guid.NewGuid().ToString();
var bytes = Encoding.UTF8.GetBytes(s);
var computeHash = murmurHash32.ComputeHash(bytes);