- Application
- Request Handling
- Authorization
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
void Main() | |
{ | |
var searchWord = "TextToSearchFor"; | |
var searchPattern = "*.js"; | |
var sourceFolder = @"C:\_Dev\TFS\MyProject\Source\"; | |
var defaultProgram = @"C:\Program Files (x86)\Notepad++\notepad++.exe"; | |
List<string> allFiles = new List<string>(); | |
var fileCount = 0; |
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
# Start-FileSystemWatcher.ps1 - File System Watcher in Powershell. | |
# Brought to you by MOBZystems, Home of Tools | |
# https://www.mobzystems.com/code/using-a-filesystemwatcher-from-powershell/ | |
[CmdletBinding()] | |
Param( | |
# The path to monitor | |
[Parameter(Mandatory=$true, Position=0)] | |
[string]$Path, | |
# Monitor these files (a wildcard) |
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
# all logging settins are here on top | |
$logFile = "log-$(gc env:computername).log" | |
$logLevel = "DEBUG" # ("DEBUG","INFO","WARN","ERROR","FATAL") | |
$logSize = 1mb # 30kb | |
$logCount = 10 | |
# end of settings | |
function Write-Log-Line ($line) { | |
Add-Content $logFile -Value $Line | |
Write-Host $Line |
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
Add-Type -Path "Serilog.dll" | |
Add-Type -Path "Serilog.Sinks.Seq.dll" | |
Add-Type -Path "Serilog.Sinks.EventLog.dll" | |
Add-Type -Path "Serilog.FullNetFx.dll" | |
Add-Type -Path "Serilog.Extras.AppSettings.dll" | |
Add-Type -Path "Serilog.Extras.Timing.dll" | |
$Config = New-Object Serilog.LoggerConfiguration | |
[Serilog.Configuration.LoggerSinkConfiguration]$ConfigSink = $config.WriteTo | |
[Serilog.Log]::Logger = [Serilog.LoggerConfigurationFullNetFxExtensions]::RollingFile($ConfigSink, "C:\Logs\Log-{Date}.txt", ([Serilog.Events.LogEventLevel]::Verbose), "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}", $null, 10000000, 15).CreateLogger() |
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
# os and sqlite3 ships with Python by default. If you get import errors for win32crypt use "pip install pypiwin32" to install the dependency. | |
import os, sqlite3, win32crypt | |
# Automatically get the logged in user's default folder | |
data = os.path.expanduser('~')+"\AppData\Local\Google\Chrome\User Data\Default\Login Data" | |
# Connect to Login Data database | |
connection = sqlite3.connect(data) | |
cursor = connection.cursor() |
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 Crc64 | |
{ | |
private static readonly ulong[] Table = { | |
0x0000000000000000, 0x7ad870c830358979, | |
0xf5b0e190606b12f2, 0x8f689158505e9b8b, | |
0xc038e5739841b68f, 0xbae095bba8743ff6, | |
0x358804e3f82aa47d, 0x4f50742bc81f2d04, | |
0xab28ecb46814fe75, 0xd1f09c7c5821770c, | |
0x5e980d24087fec87, 0x24407dec384a65fe, | |
0x6b1009c7f05548fa, 0x11c8790fc060c183, |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace [YOURNAMESPACEHERE] | |
{ | |
public static class TypeExtensions | |
{ | |
public static bool IsDerivingFrom(this Type type, Type searchType) |
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
# The code for my article with the same name. You can find it at the URL below: | |
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python | |
# MIT License | |
# | |
# Copyright (c) 2021 Manohar Vanga | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.