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
/** | |
* Following is a selector that helps to dynamically create a type from existing constants | |
* This can be really helpful to create type patterns which works flawlessly with JS dynamic behaviour | |
* and reduce the amount of code required to add specific code for each type separately | |
* | |
* Ref: https://www.typescriptlang.org/docs/handbook/2/mapped-types.html | |
*/ | |
export enum SUPPORTED_HEROES { | |
SPIDER = "spiderman", | |
SUPER = "superman", |
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
# This helps to generate gif from any video file. | |
ffmpeg -i example.mov -ss 0 \ | |
-vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \ | |
-loop 0 output.gif | |
# To stitch multiple videos together | |
# Ref: https://stackoverflow.com/a/7582140/2849127 | |
ffmpeg -i big.avi -vf "movie=small0.avi [small0]; [in][small0] overlay=10:10 [tmp];\ | |
movie=small1.avi [small1]; [tmp][small1] overlay=30:10 [out]" out.avi |
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
Show hidden characters
{ | |
"cmd": ["g++", "-Wall", "-ansi", "$file_name", "-o", "${file_base_name}"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.c++, source.cxx, source.cpp", | |
"shell": false, | |
"variants": [ | |
{ | |
"name": "Run", | |
"shell": false, |
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
/** | |
* A DOM Node Caching Compose Function, that can be used in a Classes for Old Legacy Codes | |
* that didn't use any UI Frameworks, like React | |
* | |
* @param {HTMLElement} ref - A parent reference that will be used to query, to fetch inner nodes | |
* DEFAULT: `document` | |
*/ | |
nodeCache = (ref = document) => { | |
const node = ref; | |
const cache = {}; |
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
/** | |
* Returns null if the Transform is not pre-calculated as a matrix string... | |
* else returns the translateY in Pixels... | |
* | |
* @param matrix: `window.getComputedStyle({ELEMENT}).getPropertyValue('transform')` | |
* | |
* Example: matrix = 'matrix(1, 0, 0, 1, 101.2, 186)' // [4]: translateX, [5]: translateY | |
*/ | |
getTranslateYFromMatrix = (matrix) => { | |
const match = matrix.match(/\((.*)\)/)[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
{ | |
"scripts": { | |
"start:prod:test": "npm-run-all clean build:prod:test change:hbs", | |
} | |
} |
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 { enableProdMode } from '@angular/core'; | |
import { platformBrowser } from '@angular/platform-browser'; | |
// After `ngc` command is run this ngfactory file gets generated... | |
// So Following error is useless... | |
import { AppModuleNgFactory } from '../build/src/app/app.module.ngfactory'; | |
declare var IS_PROD_TEST: boolean; | |
declare var environment; |
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
var webpack = require('webpack'); | |
var path = require('path'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const config = require('./config') | |
const extractText = new ExtractTextPlugin({ | |
filename: "[name].css" | |
}) |
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/python | |
############################################################################################### | |
# | |
# Basic Pinging API, to make calls to Google Geolocation API per second | |
# Uses Ratelimiting, for limiting the calls to one second only... | |
# | |
# * This app, uses a `.json` file [calls.json], for getting Lat/Lons, that needs to be | |
# reversegeocoded using the Google API... | |
# * Uses Formatter, to format String, as required... |