Skip to content

Instantly share code, notes, and snippets.

View johnmcase's full-sized avatar

John Case johnmcase

  • Symplr
  • Wisconsin, USA
  • 13:58 (UTC -06:00)
View GitHub Profile
@johnmcase
johnmcase / propertyValuesMatcher.js
Last active August 29, 2015 14:18
Jasmine toHavePropertyValues custom matcher
'use strict';
define([], function() {
var toHavePropertyValues = function(util, customEqualityTesters) {
return {
compare: function(actual, expected) {
// actual is an object
// expected is an object
// The actual must contain all properties specified in expected and have matching values
var result = {pass: true};
@johnmcase
johnmcase / ConfigService.js
Created May 15, 2015 17:40
Simple Angular Mocking Example
// In src/ directory
angular.module('services.configService', []).service('ConfigService', [function() {
return {'I': 'am not a mock'};
}]);
@johnmcase
johnmcase / .gitconfig
Last active June 18, 2018 19:45
Git setup
[user]
email = [email protected]
name = John Case
[http]
proxy = http://am.proxy.ge.com:80/
[https]
proxy = http://am.proxy.ge.com:80/
[core]
pager = diff-so-fancy | less --tabs=4 -RFX
[alias]
@johnmcase
johnmcase / updateNpm.bat
Last active October 6, 2022 16:28
Update npm on windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@johnmcase
johnmcase / Bookmark
Last active June 5, 2018 16:17
Bookmarkable in-browser notepad. Credit: https://coderwall.com/p/lhsrcq/one-line-browser-notepad
data:text/html, <title>Text Editor</title><style>html,body{margin: 0; padding: 0;}</style><textarea style="font-size: 1.5em; line-height: 1.5em; background: %23000; color: %233a3; width: 100%; height: 100%; border: none; outline: none; margin: 0; padding: 90px;" autofocus placeholder="wake up Neo..." />
var glob = require("glob")
Reset = "\x1b[0m"
FgRed = "\x1b[31m"
FgGreen = "\x1b[32m"
FgYellow = "\x1b[33m"
FgWhite = "\x1b[37m"
let specs = glob.sync("src/**/*.spec.ts");
let tests = glob.sync("src/**/*.test.ts");
@johnmcase
johnmcase / .profile
Last active April 14, 2023 15:58
My common git aliases
alias gitclean='git clean -dfx'
alias glog='git log --graph --topo-order --pretty="%C(auto)%h %<(15,trunc)%an %<(15,trunc)%ar %C(cyan)%<(65,trunc)%s %C(auto)%D"'
alias uuid='node -e "console.log(require(\"crypto\").randomUUID())"'