Skip to content

Instantly share code, notes, and snippets.

View Arithmomaniac's full-sized avatar

Avi Levin Arithmomaniac

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@binduchinnasamy
binduchinnasamy / FunctionEnableDisable.ps1
Last active January 14, 2021 07:57
Powershell run book to enable or disable azure function
$connectionName = "AzureRunAsConnection"
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
Add-AzureRmAccount -ServicePrincipal -TenantId $servicePrincipalConnection.TenantId -ApplicationId $servicePrincipalConnection.ApplicationId -CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
$functionname="<<FunctionAppName>>"
$resourceGroupName ="<<Resource Group Name>>"
$webApp = Get-AzureRmWebApp -ResourceGroupName $resourceGroupName -Name $functionname
$appSettingList =$webApp.SiteConfig.AppSettings
$appSettings = @{}
ForEach ($kvp in $appSettingList) {
$appSettings[$kvp.Name] = $kvp.Value
@mstum
mstum / Benchmark.txt
Last active April 17, 2023 15:02
Fully Managed alternative to StrCmpLogicalW
BenchmarkDotNet=v0.10.13, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.309)
Intel Core i7-6700HQ CPU 2.60GHz (Skylake), 1 CPU, 8 logical cores and 4 physical cores
Frequency=2531253 Hz, Resolution=395.0613 ns, Timer=TSC
[Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2633.0
Clr : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2633.0
Job=Clr Runtime=Clr
Method | Mean | Error | StdDev | Allocated |
---------------------------- |---------:|---------:|---------:|----------:|
@branneman
branneman / getMousePosition.js
Last active July 7, 2019 10:40
getMousePosition(event) - cross browser normalizing of: clientX, clientY, screenX, screenY, offsetX, offsetY, pageX, pageY
/**
* @param {Event} evt
* @return {Object}
*/
function getMousePosition(evt) {
var pageX = evt.pageX;
var pageY = evt.pageY;
if (pageX === undefined) {
pageX = evt.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
@jeremiahredekop
jeremiahredekop / PipingExtensions.cs
Last active July 21, 2017 17:50
Piping c# extension methods
public static class PipingExtensions
{
/// <summary>
/// Take an object, pipe it into a function, and return the result.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <param name="obj"></param>
/// <param name="f"></param>
/// <returns></returns>
@lennybacon
lennybacon / FusionLog.ps1
Created November 27, 2014 14:07
Manage Fusion Log by Powershell
function Enable-FusionLog{
Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name EnableLog -Value 1 -Type DWord
}
function Disable-FusionLog{
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name EnableLog
}
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",