Skip to content

Instantly share code, notes, and snippets.

View shemmjunior's full-sized avatar
🎯
Focusing

Shemm Junior shemmjunior

🎯
Focusing
View GitHub Profile
@shemmjunior
shemmjunior / README.md
Created September 30, 2020 10:47 — forked from mbleigh/README.md
Firebase Hosting Fetch All Files

Fetch All Files from Firebase Hosting

This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.

Running via NPX

npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>
@shemmjunior
shemmjunior / basic.css
Created June 14, 2021 20:18
Basic css
.center-card {
margin: auto;
width: 50%;
padding: 10px;
}
.avatar-center {
display: block;
margin-left: auto;
margin-right: auto;
@shemmjunior
shemmjunior / geo.js
Created June 14, 2021 20:20 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@shemmjunior
shemmjunior / monitoring_binary_logs.js
Created July 4, 2021 10:09 — forked from Rowadz/monitoring_binary_logs.js
Monitoring binary logs via Nodejs
const mysql = require('mysql');
const MySQLEvents = require('@rodrigogs/mysql-events');
const ora = require('ora'); // cool spinner
const spinner = ora({
text: '🛸 Waiting for database events... 🛸',
color: 'blue',
spinner: 'dots2'
});
const program = async () => {
@shemmjunior
shemmjunior / count_duplicate_items_in_array.js
Last active July 21, 2021 07:23
Count Duplicate items in Array by Key
filterArr(data, key){
return data.reduce( (result, current) => {
if(!result[current[key]]){
result[current[key]] = 1;
} else {
result[current[key]] += 1;
}
return result;
}, {})
}
@shemmjunior
shemmjunior / tsconfig.json
Last active July 21, 2021 07:23
Angular Strict Templates
// tsconfig.json
"angularCompilerOptions": {
"strictTemplates": true, // or false
"strictInjectionParameters": true
}
@shemmjunior
shemmjunior / main.yml
Created July 21, 2021 07:25
Firebase CI/CD Angular Project
name: Firebase Deploy
on:
push:
branches:
- master
jobs:
build:
@shemmjunior
shemmjunior / setup.sh
Created July 29, 2021 13:11 — forked from tolleiv/setup.sh
CMUSphinx (tutorial) setup
#!/bin/bash
# see http://cmusphinx.sourceforge.net/wiki/tutorialam
# see http://mnemonicplace.blogspot.de/2010/06/cmu-sphinx-error-wave2feat-error-while.html
sudo apt-get install build-essential autoconf libtool automake python-dev subversion bison vim
export PATH=/usr/local/bin:/usr/local/libexec/sphinxtrain:$PATH
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
mkdir ~/tutorial
cd ~/tutorial
@shemmjunior
shemmjunior / typings.d.ts
Last active August 2, 2021 08:23
Enable json imports in Angular
declare module "*.json" {
const value: any;
export default value;
}
// Then Add the following Lines in tsconfig.json
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
@shemmjunior
shemmjunior / hide-header.directive.ts
Created August 11, 2021 11:49 — forked from klemensz/hide-header.directive.ts
Hide header on scroll in Ionic 5
import { Directive, HostListener, Input, OnInit, Renderer2 } from '@angular/core';
import { DomController } from '@ionic/angular';
/**
* Moves away the header when scrolling down.
*/
@Directive({
selector: '[appHideHeader]',
})
export class HideHeaderDirective implements OnInit {