Skip to content

Instantly share code, notes, and snippets.

@Hordern
Hordern / git_commands_1
Last active August 30, 2017 20:41
Simple everyday git commands - print out
/* show last commit comment */
git log -1 --pretty=%B
/* This will Show just the first line of the last n commit messages. */
git log --oneline -n
/* show last commit comment and code */
git show
export class Coordinates {
latitude: string | number;
longitude: string | number;
accuracy?: number;
constructor(that?: Coordinates) {
if (that) {
this.latitude = +that.latitude;
this.longitude = +that.longitude;
this.accuracy = +that.accuracy;
@Hordern
Hordern / angular2_relative_routing.md
Created April 26, 2017 21:57
Angular2 relative routing

http://stackoverflow.com/a/38808116/3863932

routerLink]="['/absolute']" [routerLink]="['../../parent']" [routerLink]="['../sibling']" [routerLink]="['./child']" // or [routerLink]="['child']"

// with route param ../sibling;abc=xyz [routerLink]="['../sibling', {abc: 'xyz'}]"

@Hordern
Hordern / angular2meteor-starter-steps.md
Created April 7, 2017 22:31
Angular2Meteor starter project steps

/* Use the following starter poject */ git clone https://github.com/bsliran/angular2-meteor-base project-name

npm install

/* Until the above project is updated we need to update angular2 to angular4 */ npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@latest typescript@latest --save

@Hordern
Hordern / Upgrade_Angular2_to_Angular4.md
Last active April 7, 2017 22:26
Upgrade Angular2 to Angular4

/* This works on standard Angular2 project & Angular2Meteor project */ npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@latest typescript@latest --save

/* Consider installing this tool.

  • npm-check-updates. It's the simplest way to upgrade all dependencies in your package.json. */

To install npm-check-updates: npm i -g npm-check-updates

@Hordern
Hordern / git_show_branches
Created March 3, 2017 02:36
Git display/show branches and commits
git log --graph --decorate --oneline
For branch names and a compact view, try:
git log --graph --decorate --oneline
@Hordern
Hordern / excel_remove_rightmost_word
Created February 7, 2017 20:00
Excel remove right-most word
=LEFT(TRIM(A2),FIND("~",SUBSTITUTE(A2," ","~",LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ",""))))-1)
@Hordern
Hordern / Git checkout remote branch
Created October 14, 2016 00:16 — forked from markSci5/Git checkout remote branch
Git checkout remote branch
//To fetch a branch, you simply need to:
git fetch origin
//This will fetch all of the remote branches for you. With the remote branches
//in hand, you now need to check out the branch you are interested in, giving
//you a local working copy:
git checkout -b test origin/test
@Hordern
Hordern / .gitignore
Created September 7, 2016 00:05 — forked from salcode/.gitignore
WordPress .gitignore - this is my preferred gitignore file when working with WordPress. It ignores almost all files by default.
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20160309
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@Hordern
Hordern / angular-cli-new-cmd-error
Created September 5, 2016 02:58
Fixes angular-cli error when ng new cmd is used
sudo chown daniel /Users/daniel/.config/configstore/ember-cli.json