Skip to content

Instantly share code, notes, and snippets.

@martinobordin
martinobordin / AngularRxJs5DateHttpInterceptor.ts
Last active September 22, 2023 08:23
An Angular interceptor to parse string dates (ISO8601 format) from server response to JS Date Object. There are both RxJs 5 and RxJs 6 versions
import { Injectable } from '@angular/core';
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor, HttpErrorResponse, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/do';
@Injectable()
export class AngularDateHttpInterceptor implements HttpInterceptor {
// Migrated from AngularJS https://raw.githubusercontent.com/Ins87/angular-date-interceptor/master/src/angular-date-interceptor.js
iso8601 = /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?$/;
@0xjac
0xjac / private_fork.md
Last active June 24, 2024 04:18
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

/**
* Knockout.js extension that gives both new and old value to
* subscription functions.
*
* Credit: http://stackoverflow.com/a/18184016/204610
*
* Changed JBeagle's code to return a disposable subscription
* object so it conforms to subscribe()
*/
ko.subscribable.fn.subscribeChanged = function (callback) {
@codewings
codewings / Photoshop_Constants_Rosetta_Stone
Last active July 4, 2023 07:03
Photoshop Constants Rosetta Stone
PSConstants -> value -> CharID TypeIDToStringID
---------- -> ----- -> ------ ----------------
phDialogDontDisplay -> 0 ->
phEnumBitDepthA1R5G5B5 -> 825570869 -> "1565"
phEnumBitDepthA4R4G4B4 -> 875836468 -> "4444"
phEnumAmiga -> 1097688929 -> "Amga"
phKeyArrowhead -> 1098019447 -> "Arrw"
phEventBackLight -> 1113678668 -> "BacL"
phClassBackLight -> 1113680716 -> "BakL"
phEnumBitDepth16 -> 1111765302 -> "BD16"