Skip to content

Instantly share code, notes, and snippets.

@joeskeen
joeskeen / FindConflictingAppointments.vb
Last active April 25, 2020 19:48
Outlook macro that searches for and displays appointments that conflict with the current appointment
' Searches for and displays appointments that conflict with the current appointment
' If a recurring appointment, the recurrance must be saved before conflicts will be checked
' If a recurring appointment, only checks the next 50 future instances of the recurrance
' Only checks your calendar, not the calendars of other attendees
' Based on macro from https://www.datanumen.com/blogs/quickly-find-appointments-conflicting-specific-appointment-outlook/
Sub FindConflictingAppointments()
Dim objAppointment As AppointmentItem
Dim dStartTime, dEndTime As Date
Dim strFilter As String
Dim objAppointments As Items
@joeskeen
joeskeen / hackathon.md
Last active October 25, 2019 05:00
React Conf 2019 Hackathon

Are you ready to have some fun?

We spend most days working to build good software, to please customers, and to build impressive projects for our resume. Tonight is different. Tonight we are going to the other extreme - writing a completely obnoxious, unintuitive, or otherwise unusable user interface. Inspired by programmers on Reddit, we're going to push the envelope of bad UX in React.

Write the worst form control you can think of! Here are some ideas of controls to mangle:

  • A date picker
  • A US state selector
  • A captcha
@joeskeen
joeskeen / preferences.service.spec.ts
Created October 1, 2019 23:17
A sample spec using a beforeEach block
describe('PreferencesService', () => {
describe('.getPreference', () => {
let service: PreferencesService;
let testValue: Observable<string>;
let result: Observable<string>;
let getItemSpy: jasmine.Spy;
beforeEach(() => {
testValue = scheduled(['test value'], asapScheduler);
getItemSpy = jasmine.createSpy('getItem').and.returnValue(testValue);
@joeskeen
joeskeen / preferences.service.spec.ts
Created October 1, 2019 23:14
A sample spec demonstrating Arrange, Act, Assert
describe('PreferencesService', () => {
describe('.getPreference', () => {
it('should call getItem from LocalStorage', () => {
// Arrange: initialize spy and test subject
const getItemSpy = jasmine.createSpy('getItem');
const service = new PreferencesService({ getItem: getItemSpy } as LocalStorage);
// Act: call getPreference
service.getPreference('test key');
import { Injectable } from '@angular/core';
import { LocalStorage } from '@ngx-pwa/local-storage';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@Injectable()
export class PreferencesService {
constructor(private localStorage: LocalStorage) {
}
@joeskeen
joeskeen / is-palindrome.spec.ts
Created September 16, 2019 18:37
a sample spec file for an isPalindrome function
describe('isPalindrome', () => {
describe('when provided a palindrome', () => {
describe('consisting of letters', () => {
it('should classify `"racecar"` as a palindrome');
describe('ignoring case', () => {
it('should classify `"Racecar"` as a palindrome');
});
describe('ignoring spaces', () => {
it('should classify `"taco cat"` as a palindrome');
});
@joeskeen
joeskeen / is-integer.spec.js
Created September 16, 2019 16:34
a sample specification for a function that determines whether a given value is an integer
describe('isInteger', () => {
describe('when provided an integer value', () => {
it('should classify 5 as an integer');
it('should classify -5 as an integer');
it('should classify 0 as an integer');
});
describe('when provided a numerical value that is not an integer', () => {
it('should classify 3.14 as not an integer');
it('should classify -3.14 as not an integer');
it('should classify NaN as not an integer');
/**
* Returns whether the given value is an integer
* @param value the value to test
* @returns whether the value is an integer
*/
export function isInteger(value) {
return Math.floor(value) == value;
}
@joeskeen
joeskeen / gist:f27c22e5ec179c8773237049ac1a6aac
Created July 12, 2019 15:11
Trying to get Git LFS to work with Azure Repos
joeskeen@DESKTOP /mnt/c/code/sandbox/bug-repro
$ git clone git@ssh.dev.azure.com:v3/joeskeen/Test%20Project/With%20File%20Size%20Restriction
Cloning into 'With%20File%20Size%20Restriction'...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.
joeskeen@DESKTOP /mnt/c/code/sandbox/bug-repro
$ git clone git@ssh.dev.azure.com:v3/joeskeen/Test%20Project/Without%20File%20Size%20Restriction
Cloning into 'Without%20File%20Size%20Restriction'...
warning: You appear to have cloned an empty repository.
@joeskeen
joeskeen / case.pipe.ts
Last active March 27, 2019 19:07
Angular pipe for changing to any case (esp. not those included in @angular/common)
import { PipeTransform, Pipe } from '@angular/core';
import * as changeCase from 'change-case';
type TransformFn = (val: string) => string;
@Pipe({ name: 'joeCase', pure: true })
export class CasePipe implements PipeTransform {
/**
* changes the case of a value
* @param value the value to change the case of