Skip to content

Instantly share code, notes, and snippets.

View rjmccluskey's full-sized avatar
👨‍💻

Richard McCluskey rjmccluskey

👨‍💻
View GitHub Profile
RAISERROR('your message here',16,1)
@rjmccluskey
rjmccluskey / InputWithSetter.ts
Last active May 27, 2016 00:14
Manipulate Angular 2 Input on change with setter
@Component({
selector: 'example-component'
})
export class ExampleComponent {
@Input() set myInput(newValue: string) {
// now you can do stuff here whenever the input is changed!
}
}
@rjmccluskey
rjmccluskey / .gitconfig
Last active July 13, 2016 19:03
Git alias for initial push of a new branch. Add this to your .gitconfig and simply enter "git psu" in your command prompt (psu stands for "push set upstream")
[alias]
psu = !git push -u origin $(git rev-parse --abbrev-ref HEAD)
@rjmccluskey
rjmccluskey / example-component.ts
Last active October 17, 2021 04:47
Angular 2 Input with TypeScript property (getter and setter)
import { Component, Input } from '@angular/core';
@Component({
selector: 'example',
template: `{{data}}` // getting `data` in the template will call the getter method!
})
export class ExampleCoponent {
private dataInternal: number;
@Input() set data(data: number) {
@rjmccluskey
rjmccluskey / recursive-mocha.json
Last active June 4, 2018 21:04 — forked from timoxley/gist:1721593
Recursively run all tests in test directory using mocha
// this will find all files ending with .spec.js and run them with Mocha. Put this in your package.json
// The quotes around test/**/*.spec.js are required
{
"scripts": {
"test": "mocha 'test/**/*.spec.js'"
}
}