Skip to content

Instantly share code, notes, and snippets.

Atif Aziz atifaziz

Block or report user

Report or block atifaziz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@atifaziz
atifaziz / git-aliases.txt
Last active Dec 12, 2019
My Git aliases
View git-aliases.txt
git config --global alias.aliases "config --get-regexp ^alias\."
git config --global alias.last "log -1 HEAD"
git config --global alias.ls "log --decorate --pretty=format:%Cgreen%h%Cred%d%Creset\ %s\ [%an]"
git config --global alias.ll "log --pretty=fuller"
git config --global alias.st "status"
git config --global alias.diffc "diff --cached"
git config --global alias.ci "commit"
git config --global alias.cia "commit --amend"
git config --global alias.mff "merge --ff-only"
git config --global alias.mt "mergetool"
View QueenSongs.linq
<Query Kind="Expression">
<NuGetReference Version="3.1.0">System.Reactive</NuGetReference>
<NuGetReference Version="1.2.0">TryParsers</NuGetReference>
<NuGetReference Version="1.0.0-alpha-20170321T1506" Prerelease="true">WebLinq</NuGetReference>
<Namespace>static WebLinq.Modules.HttpModule</Namespace>
<Namespace>System.Reactive</Namespace>
<Namespace>System.Reactive.Linq</Namespace>
<Namespace>TryParsers</Namespace>
<Namespace>WebLinq</Namespace>
<Namespace>WebLinq.Html</Namespace>
@atifaziz
atifaziz / Get-MyNuGetApiKeys.ps1
Created Feb 28, 2018
Show ApiKeys from NuGet.Config
View Get-MyNuGetApiKeys.ps1
Add-Type -AssemblyName System.Security; ([xml](type -Raw C:\Users\aziz1a\AppData\Roaming\NuGet\NuGet.Config)).configuration.apiKeys.add | Add-Member -PassThru original -Type ScriptProperty { [Text.Encoding]::UTF8.GetString([Security.Cryptography.ProtectedData]::Unprotect([Conver
t]::FromBase64String($this.value), [Text.Encoding]::UTF8.GetBytes('NuGet'), 'CurrentUser')) }
View EnumerableWrapper.g.csx
#r "System.Net.Http"
#r "System.Threading.Tasks"
#r "packages\Microsoft.CodeAnalysis.CSharp.2.3.2\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll"
using System.Net.Http;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
var source = await new HttpClient().GetStringAsync("https://gist.githubusercontent.com/atifaziz/779846996638e50cbf11554c75739178/raw/8e0ef8f52c1beadd5f6a6cbb464737e2bce0f9c9/Enumerable.cs");
@atifaziz
atifaziz / Enumerable.cs
Created Sep 19, 2017
System.Linq.Enumerable meta-view
View Enumerable.cs
namespace System.Linq
{
//
// Summary:
// Provides a set of static (Shared in Visual Basic) methods for querying objects
// that implement System.Collections.Generic.IEnumerable`1.
public static class Enumerable
{
//
// Summary:
@atifaziz
atifaziz / ValueTupleEqualityComparer.g.cs
Last active Sep 12, 2017
IEqualityComparer<> implementations for value tuples with a custom comparer per element
View ValueTupleEqualityComparer.g.cs
#region The MIT License (MIT)
//
// Copyright (c) 2017 Atif Aziz. All rights reserved.
//
// 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 to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
@atifaziz
atifaziz / dotnet-install-v1.0.0-preview2.0.1.ps1
Created Apr 26, 2017
PowerShell script to install .NET Core SDK v1.0.0-preview2.0.1
View dotnet-install-v1.0.0-preview2.0.1.ps1
curl https://raw.githubusercontent.com/dotnet/cli/v1.0.0-preview2.0.1/scripts/obtain/dotnet-install.ps1 -OutFile dotnet-install.ps1
.\dotnet-install.ps1 -InstallDir dotnet -Verbose -Version 1.0.0-preview2-003131
@atifaziz
atifaziz / TupleVsValueTupleBenchmarks.cs
Last active Apr 4, 2017
Benchmarking performance of reference versus value tuples
View TupleVsValueTupleBenchmarks.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class TupleVsValueTupleBenchmarks
@atifaziz
atifaziz / mockaroo.csv
Last active Apr 4, 2017
Test data generated using Mockaroo
View mockaroo.csv
id first_name last_name email gender ip_address
1 Daniel Kelley dkelley0@instagram.com Male 148.111.121.121
2 Ann Perez aperez1@nih.gov Female 21.193.101.17
3 Jesse Cole jcole2@issuu.com Male 164.43.98.144
4 Charles Patterson cpatterson3@princeton.edu Male 211.15.88.119
5 Walter Rogers wrogers4@wikimedia.org Male 41.92.242.12
6 Albert Taylor ataylor5@ucoz.ru Male 117.104.110.112
7 Harold Alvarez halvarez6@constantcontact.com Male 52.183.25.59
8 Jessica Griffin jgriffin7@mozilla.com Female 36.40.157.18
9 Gregory Watkins gwatkins8@opensource.org Male 55.42.33.241
@atifaziz
atifaziz / Unprotect-ProtectedData.ps1
Created Mar 31, 2017
Decrypting DPAPI-protected Base64 data from PowerShell
View Unprotect-ProtectedData.ps1
Add-Type -AssemblyName System.Security;
[Text.Encoding]::ASCII.GetString([Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String((type -raw (Join-Path $env:USERPROFILE foobar))), $null, 'CurrentUser'))
You can’t perform that action at this time.