Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Ross wickdninja

View GitHub Profile
@wickdninja
wickdninja / basic-dev.ps1
Created Jun 20, 2020 — forked from flcdrg/basic-dev.ps1
My BoxStarter Scripts
View basic-dev.ps1
# SQL Server - do this early to avoid issues with newer versions of VC++ 2015 redist
choco install sql-server-2017
choco install sql-server-2017-cumulative-update
choco install sql-server-management-studio
# tools
choco install git
choco install nodejs
choco install tortoisegit
choco install vscode
@wickdninja
wickdninja / boxstarter.ps1
Last active Jun 22, 2020 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Author: Nate Ross @wickdninja (https://wickd.ninja)
# HEAVILY BASED ON https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f
# Thanks to Jess Frazelle <jess@linux.com>
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
View keybase.md

Keybase proof

I hereby claim:

  • I am wickdninja on github.
  • I am wickdninja (https://keybase.io/wickdninja) on keybase.
  • I have a public key ASCz-gAS67L039MD5LlG9OWvlIzhQmnAvv11hpw27svb2Qo

To claim this, I am signing this object:

View ach_test_and_fix.cs
// SQL TO FIND PAYMENT
// select PayToAccount,PayFromAccount,PayToName,memo,shardkey,amount,payfrom,* from Payments where CollectionDate = '12/04/2019' and amount = 500
// TEST TO FIX PAYMENT
[Test]
public void Remove_Special_Character()
{
Guid paymentID = new Guid("871fa1b5-0b49-4444-8bde-17595fea7340");
string pattern = @"[^a-zA-Z0-9\s\.\-\&\'\(\)\/\\\:\,\#\$\;\!\+\|]|[\t\u00a0]";
Regex reg = new Regex(pattern);
View GetAggregateTest.cs
[Test]
public void Get_Aggregates()
{
var ids = new List<string>
{
"GUID_HERE"
};
foreach (var id in ids)
{
using (var uow = UnitOfWork.Create())
@wickdninja
wickdninja / failing-unit-test.md
Created Nov 10, 2018
How to write unit test for Ionic 4 when the component has child routes?
View failing-unit-test.md

Failing test log

ClientsPage should create FAILED
        Error: StaticInjectorError(DynamicTestModule)[IonRouterOutlet -> ChildrenOutletContexts]:
          StaticInjectorError(Platform: core)[IonRouterOutlet -> ChildrenOutletContexts]:
            NullInjectorError: No provider for ChildrenOutletContexts!
            at NullInjector.get (webpack:///./node_modules/@angular/core/fesm5/core.js?:1360:19)
            at resolveToken (webpack:///./node_modules/@angular/core/fesm5/core.js?:1598:24)
            at tryResolveToken (webpack:///./node_modules/@angular/core/fesm5/core.js?:1542:16)
View DeviceClassAppender.js
var classNames = [];
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/i)) classNames.push('ios');
if (navigator.userAgent.match(/android/i)) classNames.push('android');
var html = document.getElementsByTagName('html')[0];
if (html.classList) html.classList.add.apply(html.classList, classNames);
View IFrameClassAppender.js
var IFrameClassAppender = (function (window, $, self, undefined) {
// ReSharper disable once InconsistentNaming
var isFrame, body, ua, iOS, iOS8;
self.init = function () {
isFrame = (window.top !== window.self);
if (isFrame) {
body = $('body');
body.addClass('iframe');
ua = navigator.userAgent.toLowerCase();
View promise-example.js
const asyncThingWithPromise = () => {
var promise = new Promise((resolve, reject) => {
try{
// do something async here. Like get data from a server or read a file from disk etc.
var value = 'My Async Data';
resolve(value) // handled by promise's then()
}catch(error){
reject(error) // handled by promise's catch()
}
You can’t perform that action at this time.