Skip to content

Instantly share code, notes, and snippets.

View bcawrse's full-sized avatar

Ben Cawrse bcawrse

View GitHub Profile
@bcawrse
bcawrse / roslynFix.md
Created May 19, 2020 16:47
Rolsyn csc.exe missing for ASP .Net MVC applications

Error with csc.exe missing on build

This error crops up every once in awhile when swapping projects. This stack overflow has a good overview / solution SO Link; the answer with the most votes, not the accepted answer.

Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r

@bcawrse
bcawrse / winIpReset.md
Last active May 6, 2020 18:33
Windows IP reset for VPN issues

Reset Windows TCP / IP For Clearing VPN Issues

Run these commands in an elevated command prompt.

netsh winsock reset
netsh int ip reset
ipconfig /release
ipconfig /renew
ipconfig /flushdns

@bcawrse
bcawrse / gist:97e7df22fc3fddc3c501f8ae7cb215ee
Last active March 7, 2020 02:23
Docker CLI clif-Notes

Docker CLI Refresher for when it's been awhile

Running things

Docker Compose!

docker-compose is super helpful to start docker stuff. Create a docker file, I've been having the best luck with version 3.1, and run docker-compose up. It's super nice.

docker-compose up -d runs docker-compose in detatched mode.

Side-notes

Breweries around Hampton Roads!

If you care most about seeing cool breweries with good beer I'd be sure to hit The Veil, O'Connor, Wasserhund, Back Bay's Farmhouse, and Big Ugly. I probably wouldn't do them all in a day because they're so spread out but they're my favorites. I'd recommend hitting all of norfolk and an area of Va Beach for a long day of brewery hopping, then pottentially snagging the outliers another day. most rotate through food trucks, but you'll have to call or check their calendar to be sure; a few have food on-site.

Norfolk Scene

If you're focused on Norfolk I'd hit Benchtop, Smartmouth, Elation, ( food at hanks? ), The Veil ( food at the veil? ), O'Connor ( normally food trucks? ), Rip Rap, Maker's w/ a cigar.

All pretty close to each other we've got...

/****** Object: StoredProcedure [dbo].[usp_showIndexFragmentation] Script Date: 12/10/2019 3:15:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
@bcawrse
bcawrse / Package-Restore.md
Last active September 6, 2019 21:20
Simple details for Update-Package -Reinstall within Visual Studio for NuGet on .Net 4

Using Update-Package -Reinstall for NuGet

Tired of having to look this up everytime I need it, so saving it in a gist. Original SO answer

Note you can force package restore to execute by running the following commands in the nuget package manager console

Update-Package -Reinstall

Forces re-installation of everything in the solution.

function sendEmail() {
try {
var ss = SpreadsheetApp.getActive();
var ssID = ss.getId();
var date = Utilities.formatDate(new Date(), "GMT+5", "dd/MM/yyyy")
var subject = "Subject of Email : " + date;
var message = "Message in email body"
var sheet = DriveApp.getFileById(ssID);
var sentbyName = "Name shown for email sentby";
var email = Session.getEffectiveUser();
@bcawrse
bcawrse / flatten.js
Last active August 21, 2019 21:40
Flatten example written in Node with jest tests
/**
* Flattens provided array.
*
* If an array is provided, this function will flatten it.
* EXAMPLE: flatten([[1, 2, [3]], 4]) returns [1, 2, 3, 4].
*
* @throws Throws an exception if provided parameter is not an Array.
* @param {Array} arr Array to flatten.
* @return {array} Flattend Array.
**/
# Set the editor to vim.. duh
git config --global core.editor vim
# Add aliases
git config --global alias.logthis 'log --decorate --date-order --graph --tags HEAD'
git config --global alias.logall 'log --decorate --date-order --remotes --graph --tags --branches'
git config --global alias.logalls 'log --decorate --date-order --remotes --graph --tags --branches --stat'
git config --global alias.diffc 'diff --cached'
git config --global alias.count 'count-objects -vH'
git config --global alias.package '"!f() { git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $1..HEAD; }; f"'
@bcawrse
bcawrse / terminalFlatTheme.sh
Created August 17, 2019 21:02 — forked from anmoljagetia/terminalFlatTheme.sh
This gist shows how to setup terminal colors in the new gnome-terminal (v 3.14) and above. This was generated using a site called http://terminal.sexy
#!/usr/bin/env bash
# Base16 - Gnome Terminal color scheme install script
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="terminal.flat.theme"
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="terminal-flat-theme"
[[ -z "$DCONF" ]] && DCONF=dconf
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen
dset() {
local key="$1"; shift