Skip to content

Instantly share code, notes, and snippets.

View michaellperry's full-sized avatar

Michael L Perry michaellperry

View GitHub Profile
@michaellperry
michaellperry / upgrade_gatsby.sh
Created April 10, 2022 14:03
Upgrade gatsby.js and all plugins to the latest version
cat package.json | jq -r '.dependencies | keys | map(select(startswith("gatsby")) | "\(.)@latest") | join(" ")' | xargs npm
i
@michaellperry
michaellperry / GitAliases.sh
Last active August 5, 2023 17:37 — forked from trayburn/GitAliases.sh
Tim Rayburn's GIT Aliases
git config --global alias.a 'add -A'
git config --global alias.b 'branch'
git config --global alias.c 'checkout'
git config --global alias.cb 'checkout -b'
git config --global alias.d 'diff'
git config --global alias.f 'fetch'
git config --global alias.l 'log --pretty=oneline --abbrev-commit'
git config --global alias.r 'rebase --interactive HEAD~10'
git config --global alias.s '-p status'
public static class DbSetExtensions
{
public static void AddOrUpdateFaster<TEntity>(
this DbSet<TEntity> set,
Expression<Func<TEntity, int>> identifierExpression,
IEqualityComparer<TEntity> entityComparer,
params TEntity[] entities)
where TEntity : class
{
var identifierFunction = identifierExpression.Compile();
Install-WindowsUpdate -acceptEula
@michaellperry
michaellperry / chocolateyInstall.ps1
Last active August 29, 2015 14:07
Chocolatey packages for developer workstation
choco install beyondcompare
choco install TimRayburn.GitAliases
choco install gittfs
choco install mysql
choco install mysql.workbench
choco install notepadplusplus
choco install paint.net
choco install windirstat
choco install ruby
choco install fiddler
@michaellperry
michaellperry / model.fact
Created November 16, 2012 22:11
Minimal Correspondence model
namespace MyFriends;
fact Individual {
key:
string anonymousId;
query:
Friend* friends {
Friend f : f.individual = this
}
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace StatisticalLinq
{
[TestClass]
public class VarianceTest
{
[TestMethod]
public void VarianceOf10Numbers()