This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert mp3 files recursively to wav using [fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg) for [node.js](https://nodejs.org) | |
// | |
// 1. Install fluent-ffmpeg: `npm install fluent-ffmpeg` | |
// 2. Run this script: `node mp3ToWav.js [path/to/file/or/folder]` | |
convertMp3ToWav = function (input) { | |
let segments = input.split('/'); | |
let filename = segments[segments.length - 1]; | |
let extension = filename.split('.')[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// This script increments patch number (mayor.minor.patch) but you can | |
// choose to increment any other segment by modifying lines `45` to `53`. | |
// | |
// 1. Make sure you've installed *xml2js*: `$ npm install xml2js -D` | |
// 2. Save this file under `project_root/hooks/before_prepare/` | |
// 3. Done! | |
var fs = require('fs'); | |
var xml2js = require('xml2js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this step to upload sourcemaps to Sentry | |
# Don't forget to build with `--source-map=true` to generate the sourcemaps. | |
# It's recommended that you don't upload them to your production hosting | |
- script: &script-sentry-release | |
- npm i @sentry/cli@1.66.0 | |
- VERSION=$(npm run --silent version:describe) | |
- npx sentry-cli --auth-token=$SENTRY_AUTH_TOKEN releases -o $SENTRY_ORG new "$VERSION" --finalize -p $SENTRY_PROJECT | |
- npx sentry-cli --auth-token=$SENTRY_AUTH_TOKEN releases -o $SENTRY_ORG set-commits --auto $VERSION # make sure to add the repo in Sentry Dashboard | |
- npx sentry-cli --auth-token=$SENTRY_AUTH_TOKEN releases -o $SENTRY_ORG -p $SENTRY_PROJECT files "$VERSION" upload-sourcemaps ./sourcemaps | |
- npx sentry-cli --auth-token=$SENTRY_AUTH_TOKEN releases -o $SENTRY_ORG -p $SENTRY_PROJECT files "$VERSION" upload-sourcemaps ./www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ## Angular custom webpack config for compatibility with IE11 | |
* ------------------------------------------------------------ | |
* 1. Add this file to your project root. Add the modules list that needs transpiling (see below code). | |
* 2. Install dev dependencies: | |
* | |
* `$ npm i -D @angular-builders/custom-webpack:browser babel-loader @babel/core @babel/preset-env browserlist` | |
* | |
* 3. Add this to your `angular.json`: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "attach", | |
"name": "Attach", // Attach to a running node process (with `--inspect` flag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from [Angular Deploymenr](https://angular.io/guide/deployment) Guide. | |
# | |
# INSTRUCTIONS: | |
# 1. Place this file next to the app's index.html. | |
# 2. Optional: If you serve your app from a subfolder in your domain, | |
# | |
# Gist forked from: [julianpoemp](https://gist.github.com/julianpoemp/bcf277cb56d2420cc53ec630a04a3566) | |
# Check for new versions of this gist: https://gist.github.com/RaschidJFR/f6d21a03b0692f5c7a6a23954003f00b | |
# v1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Install Angular Service Worker: `$ ng add @angular/pwa --project app` | |
// 2. Generate icons: https://app-manifest.firebaseapp.com/ | |
// 3. Add PWA icons for iOS in `index.html`: | |
// ``` | |
// <link rel="apple-touch-icon" sizes="512x512" href="assets/icons/icon-512x512.png"> | |
// <link rel="apple-touch-icon" sizes="192x192" href="assets/icons/icon-192x192.png"> | |
// ``` | |
// 4. Configure service worker in `ngsw-config.json`. Don't forget to add missing Ionic .svg files in `assetGroups[].resources.files`. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Use this script to parse version tags from git describe | |
// Use `node version -h` for help | |
const { spawn, exec } = require('child_process'); | |
const program = require('commander'); | |
program | |
.name('node version') | |
.usage('[--describe | --full | --numeric | --prerelease] [--tag <version.tag>]') | |
.option('-b, --build', 'Output describe info (without version): <PRE-RELEASE-PHASE(2)>.<PRE-RELEASE-VERSION(2)>.<COMMITS(2)>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { ActivatedRoute } from '@angular/router'; | |
import { map, mergeMap, mapTo } from 'rxjs/operators'; | |
import { from } from 'rxjs'; | |
/** | |
* Check https://gist.github.com/RaschidJFR/ef9f342bc2549211df7c6f00d1a06237 for the latest version of the script | |
* @author Raschid JF Rafaelly <hello@raschidjfr.dev> | |
* @example | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, Renderer2, ElementRef, HostListener } from '@angular/core'; | |
@Directive({ | |
selector: 'img[ngxImgSpinner]', | |
exportAs: 'ngxImgSpinner' | |
}) | |
export class ImgSpinnerDirective { | |
private _loading = true; | |
private _error = false; |
NewerOlder