Skip to content

Instantly share code, notes, and snippets.

View RaschidJFR's full-sized avatar

Raschid J.F. Rafeally RaschidJFR

  • RaschidJFR
  • Toronto, Canada
View GitHub Profile
@RaschidJFR
RaschidJFR / tslint.json
Created August 11, 2019 23:12
My preferred Angular tslint settings
{
"rulesDirectory": [
"codelyzer"
],
"rules": {
"align": [true, "statements"],
"array-type": [true, "array"],
"deprecation": {
"severity": "warn"
},
@RaschidJFR
RaschidJFR / .htaccess
Last active November 7, 2021 19:00 — forked from julianpoemp/.angular-htaccess.md
Optimal .htaccess configuration for Angular 8, Angular 7, Angular 6, Angular 5 (and older) app in production incl. fix for the angular browser caching issue.
# 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
@RaschidJFR
RaschidJFR / launch.json
Last active December 5, 2021 14:44
VSCode `Launch.json` for debugging Parse Server
{
// 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)
@RaschidJFR
RaschidJFR / ftp-deploy.js
Last active August 24, 2019 02:34
Deploy to FTP/SFTP server
#!/usr/bin/env node
// This script uploads automatically a folder's content to an ftp server.
// For this gist's latest version check https://gist.github.com/RaschidJFR/d6d072d8d95e3f9b2ebd9729a8031f0b
//
// 1. Make sure you've installed as devDependencies the packages you'll need:
// * [node-flags](https://www.npmjs.com/package/node-flags) (needed)
// * [ftp-deploy](https://www.npmjs.com/package/ftp-deploy) (for normal FTP upload)
// * [ftp-diff-deployer](https://www.npmjs.com/package/ftp-diff-deployer) (for uploading diffs on normal FTP)
// * [sftp-upload](https://www.npmjs.com/package/sftp-upload) (for SFTP)
//
@RaschidJFR
RaschidJFR / environment.dev.local.js
Last active February 6, 2019 20:17
Custom webpack config for environmental variables in Ionic v3
// Configuration for develpment build on local database
module.exports = {
ENV: Object.freeze({
prod: false,
databaseUrl: 'http://localhost:1337/*******'
})
}
@RaschidJFR
RaschidJFR / lowend-preferences-config.xml
Created June 3, 2018 19:44
Ionic `configs.xml` splashscreen preferences for low-end android devices.
<!--
Some low-end android devices are too slow thus take too long to load the app,
which causes throwing error "can't load index.html".
Just add these settings after <preference name="SplashScreen" value="screen" /> in config.xml.
-->
<preference name="SplashScreenDelay" value="3000" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="loadUrlTimeoutValue" value="700000" />
<!--
@RaschidJFR
RaschidJFR / html_node_server.js
Last active July 31, 2018 19:20
Basic webserver with NodeJS and Express
#!/usr/bin/env node
// This script runs a simple server for HTML, CSS, JS files.
const publicFolder = 'www'; // Change this folder to point to your web files
const port = 8080; // Default port for web server but you can change it
// (Make sure you've installed the required dependencies)
const express = require('express');
const path = require('path');
const app = express();
@RaschidJFR
RaschidJFR / sign_apk.js
Last active April 13, 2019 23:59
Automatically sign and align apk built with Ionic v3
#!/usr/bin/env node
// ## Automatically sign and align apk ##
// Just run this script `$ node sign_apk.js`
const CONFIG_FILE_NAME = 'sign-apk.json';
const configFileStruct = {
"keystorePath": "relative/path/to/file.keystore",
"zipalignPath": "C:/Program Files (x86)/Android/android-sdk/build-tools/26.0.2/zipalign",
"apkPath": "C:/your-ionic-project-root/platforms/android/build/outputs/apk/android-release-unsigned.apk",
@RaschidJFR
RaschidJFR / mp3_to_wav.js
Last active April 24, 2024 19:42
Convert mp3 files to wav recursively using ffmpeg in node.js
// 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];
@RaschidJFR
RaschidJFR / increment_version.js
Last active October 8, 2023 03:37
This script is a simple Cordova hook to incremente Version number each time you build.
#!/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');