Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | π :tada: |
| Version tag | π :bookmark: |
| New feature | β¨ :sparkles: |
| Bugfix | π :bug: |
| /* Adapted from: https://weblogs.asp.net/dixin/use-fiddler-with-node-js | |
| /* Usage: | |
| import { Fiddler } from './../src/helpers/fiddler'; | |
| ... | |
| Fiddler.proxyRequests(); | |
| */ | |
| import * as url from 'url'; | |
| import * as http from 'http'; |
| <!-- VIEW | |
| Trick to download document silently (without opening a new tab) --> | |
| <iframe *ngIf="hiddenUrl" class="hidden" [src]="hiddenUrl"> | |
| </iframe> | |
| <!-- CONTROLLER --> | |
| public hiddenUrl: SafeUrl; | |
| ... |
| // Run it live on: https://goo.gl/dgwE2D | |
| class Example { | |
| public getCountries(fields: string[] = ['name', 'alpha2Code', 'translations', 'flag']): Observable<any[]> { | |
| const sep = (function* () { | |
| let call = 0; | |
| while (true) { | |
| yield (call++ === 0) ? '?' : '&'; | |
| } | |
| })(); |
| /** | |
| * The ultimate split path. | |
| * Extracts dirname, filename, extension, and trailing URL params. | |
| * Correct handles: | |
| * empty dirname, | |
| * empty extension, | |
| * random input (extracts as filename), | |
| * multiple extensions (only extracts the last one), | |
| * dotfiles (however, will extract extension if there is one) | |
| * @param {string} path |
| /* Disclaimer: | |
| * This snippet is provided βAS ISβ and could contain technical inaccuracies, typographical errors and out-of-date information. | |
| * Use of the information is therefore at your (very) own risk. | |
| */ | |
| /*_____________________________________________________________________________________________________________________ | |
| * Aim | |
| * Provide some solution in case of complex constructs to manage layout from an Angular point-of-view (ex: ngx-datatable) | |
| * See: https://github.com/swimlane/ngx-datatable/issues/423 | |
| * |
| // Play it on Typescript Playground: https://www.typescriptlang.org/play/ | |
| class Test { | |
| static process(): Promise<any> { | |
| let promises = [ | |
| Promise.resolve(1), | |
| Promise.resolve(2), | |
| Promise.reject(3), | |
| Promise.resolve(4), | |
| new Promise((res, rej) => { throw new Error('Boum'); }), | |
| Promise.resolve(6), |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | π :tada: |
| Version tag | π :bookmark: |
| New feature | β¨ :sparkles: |
| Bugfix | π :bug: |
| angular.reloadWithDebugInfo(); // https://github.com/angular/angular.js/issues/9515 | |
| // Check whether the tagged recordings are set to favourite | |
| var dbg_hj = angular.element($(".recordings-table-container table")).scope().pageResponses() | |
| .map(elt => { | |
| return { | |
| "index" : elt.index, | |
| "id" : elt.id, | |
| "duration" : moment.duration(elt.duration).minutes() + ':' + ('0' + moment.duration(elt.duration).seconds()).slice(-2), | |
| "favourite": elt.favourite, |
| function clone(obj) { | |
| if (Object(obj) !== obj) return obj; | |
| if (typeof obj.toJSON == 'function') { | |
| return obj.toJSON(); | |
| } | |
| var type = toString.call(obj).slice(8, -1); | |
| if (type in CLONE) { | |
| return CLONE[type].call(obj, clone); | |
| } | |
| var copy = {}; |
| declare global { | |
| interface Array<T> { | |
| groupBy(prop: T): Array<T>; | |
| } | |
| } | |
| if (!Array.prototype.groupBy) { | |
| Array.prototype.groupBy = (prop: string) => { | |
| return this.reduce(function(groups, item) { | |
| const val = item[prop]; |