Skip to content

Instantly share code, notes, and snippets.

View navneet-webority's full-sized avatar

Navneet Singh navneet-webority

View GitHub Profile
@dknoodle
dknoodle / Windows Defender Exclusions VS 2017.ps1
Last active February 27, 2025 07:27
Adds Windows Defender exclusions for Visual Studio 2017
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@JamoCA
JamoCA / web.config
Last active October 31, 2021 15:46
IIS "short, self contained, correct example" of a web.config template file for Brotli compression scheme. (Using Windows 2012 IIS 7.5. Doesn't work.)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- https://github.com/h5bp/server-configs-iis -->
<!-- https://www.iispeed.com/pagespeed/products/iisbrotli#install-scheme -->
<!-- https://weblog.west-wind.com/posts/2011/May/05/Builtin-GZipDeflate-Compression-on-IIS-7x -->
<httpCompression directory="C:\iiscompressed" minFileSizeForComp="50">
<scheme name="br" dll="c:\brotli\iisbrotli64.dll" />
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
<dynamicTypes>
@solster
solster / AzureImageCompression.cs
Last active September 17, 2017 04:17
Azure Web Job for Compression Images
namespace Solster.Azure.WebJob.Compression
{
using Microsoft.Azure.WebJobs;
using System.IO;
using System.Drawing.Imaging;
using System.Linq;
using System.Drawing;
class Program
{
@JacobAtchley
JacobAtchley / function.csx
Created January 26, 2017 04:38
azure function db maintenance
#r "System.Configuration"
#r "System.Data"
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Threading.Tasks;
public static async Task Run(TimerInfo myTimer, TraceWriter log)
{
/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@trinnguyen
trinnguyen / android_statusbarcolor.cs
Created September 24, 2016 06:43
Xamarin.Android SetStastusBarColor
void SetStatusBarColor()
{
if (Build.VERSION.SdkInt < BuildVersionCodes.Kitkat)
{
return;
}
if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
Window.ClearFlags(WindowManagerFlags.TranslucentStatus);
@writtmeyer
writtmeyer / align_to_center.xml
Created August 27, 2016 08:04
Align one view's edge to another view's center in Android's ConstraintLayout
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/target"
android:layout_width="wrap_content"
@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@zfdang
zfdang / EndlessRecyclerOnScrollListener.java
Last active August 13, 2018 03:32 — forked from ssinss/EndlessRecyclerOnScrollListener.java
RecyclerView Supporting Pull Down to Refresh & Pull Up to Load More
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = false; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 2; // The minimum amount of items to have below your current scroll position before loading more.
@JonDouglas
JonDouglas / xamarin-android-performance.md
Last active February 28, 2024 17:44
Xamarin Android Performance

Xamarin.Android Performance Issues

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Errors is to first ensure you have the proper tooling available:

  • Diagnostic MSBuild Output Enabled(Instructions)
  • Android SDK Installed
  • Android API Level Documentation