Skip to content

Instantly share code, notes, and snippets.

Louie Jay dela Cruz ljayz

View GitHub Profile
ljayz / README.MD
Created Mar 12, 2019 — forked from dan1wang/README.MD
Executing App Script functions in Firebase Cloud Functions

If you are using Firebase on a Spark (free) plan, you can only make outbound networking requests to Google services. Unfortunately, that does not include Web app deployed from App Script ( (Stackoverflow #43330192)

This is a crude example showing how to execute Apps Script using the method of Apps Script API.

In this example, the Firebase app does not store the user's OAuth id token, does not validate the access token (e.g. the access token is issued for your project, not someone else's), and does not store the refresh token (access token will expire 60min after issue if not refreshed). For production, these issues must be resolved.

ljayz / reduce.js
Created Oct 10, 2018
Javascript Array to Object
View reduce.js
//from [{key1:val1},{key2:val2},{key3:val3}] to {key1:val1,key2:val2,key3:val3}
const array = [{key1:'val1'},{key2:'val2'},{key3:'val3'}];
const arrayToObject = (accumulator, currentValue) => Object.assign(accumulator, currentValue);
array.reduce(arrayToObject, {});
ljayz / httpd-vhosts.conf
Created Sep 13, 2018
XAMPP: Fix laravel undefined index in database.php
View httpd-vhosts.conf
DocumentRoot "/path/to/laravel/application/public/folder"
ErrorLog "logs/"
CustomLog "logs/laravel.localhost.comm-access.log" common
SetEnv DATABASE_URL http://user:pass@localhost/
ljayz / .profile
Last active Sep 7, 2018
Show git branch in bash terminal
View .profile
# Install to
# Add to code below to ~.profile
# store colors
ljayz / shell
Created Aug 29, 2018
Jenkins execute shell - ignore error
View shell
docker rm -f container || echo "Container not found"
ljayz / .htaccess
Created Aug 16, 2018
Show coming-soon.html page on specific IP address
View .htaccess
#placed in .htaccess together with coming-soon.html
<IfModule mod_rewrite.c>
RewriteEngine On
# Allow all static image
RewriteRule ^static/img/(.*)$ static/img/$1 [L]
# Show coming soon page
RewriteCond %{REMOTE_ADDR} != #internal public ip address
RewriteRule ^ coming-soon.html [L]
ljayz / main.js
Created Jul 12, 2018
loading meteor npm package with plugins (moment and moment-timer)
View main.js
import moment from 'moment';
import 'moment-timer';
new moment.duration(1000).timer({ start: true, loop: true }, () => {
console.log('moment timer run');
ljayz / readme.txt
Last active Jun 17, 2020
Fix aws codecommit unable to access repository (The requested URL returned error: 403) in windows
View readme.txt
this was tested using windows10 pro
when cloning a git this error was produced
fatal: unable to access '': The requested URL returned error: 403
to fix add the following git configuration
git config --global credential.helper "!aws codecommit credential-helper $@"
git config --global credential.UseHttpPath true
check if git has system credential.helper by typing
ljayz / modal.css
Last active Mar 19, 2018
Bootstrap 3 modal body auto height
View modal.css
.modal .modal-body {
max-height: calc(100vh - 200px);
overflow-y: auto;
You can’t perform that action at this time.