Skip to content

Instantly share code, notes, and snippets.

Nate Ross wickdninja

Block or report user

Report or block wickdninja

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
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()
}
@wickdninja
wickdninja / SimpleHttpClient.cs
Created Feb 14, 2018 — forked from bryanbarnard/SimpleHttpClient.cs
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy
View SimpleHttpClient.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net;
namespace HTTP_Test
View commit-msg (bash)
#!/bin/sh
# Require Jira Ticket in commit message
WARNING="Jira ABP ticket reference NOT FOUND but is required!"
MESSAGE=$(<$1)
case "$MESSAGE" in
"ABP-"*)
exit 0;
;;
*"ABP-"*)
WARNING="Jira ABP reference MUST be the 1st token in your message!"
View commit-msg (node)
#!/usr/bin/env node
var message = process.argv[2];
var hasTicketRef = (message !== undefined && message !== null && message.length > 0 && message.substring(0,4) === 'ABP-');
var exitCode = (hasTicketRef)? 0 : 1;
if(!hasTicketRef){
console.log('Jira ABP ticket reference required! \n Example:\n git commit -m "ABP-0000 #resolve #time 3h 20m"');
}
process.exit(exitCode);
View another useful gitconfig
# core {{{
[core]
editor = /usr/bin/vim
excludesfile = /Users/np/.gitignore_global
pager=less -x4
#}}}
# user {{{
[user]
email = npaolucci@atlassian.com
You can’t perform that action at this time.