Skip to content

Instantly share code, notes, and snippets.

@ljayz
ljayz / README.MD
Created March 12, 2019 03:16 — 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 (script.google.com/macros/s/.../exec). (Stackoverflow #43330192)

This is a crude example showing how to execute Apps Script using the scripts.run 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
ljayz / console_log.sublime-snippet
Last active November 9, 2018 05:01 — forked from hzlzh/gist:3128038
Snippet for Sublime Text 3
<snippet>
<!-- put this file in /Packages/User/console_log.sublime-snippet -->
<content><![CDATA[console.log($SELECTION$1);]]></content>
<tabTrigger>log</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
#!/bin/bash
##
# Modified version of https://gist.github.com/3680107
#
# Tested for use on Mac OS X 10.7.5 with Bash 3.2.48(1)-release
#
# Old module needs to be in system/cms/modules and a single word (Ex: blogs not site_blogs)
##
@ljayz
ljayz / dabblet.css
Created August 10, 2012 09:23 — forked from abernier/index.css
Vertical centering CSS technique
/**
* Vertical centering CSS technique
*/
div:before,
div p {display:inline-block; vertical-align:middle;}
div:before {content:" "; height:100%;}