Skip to content

Instantly share code, notes, and snippets.

View lgs's full-sized avatar

Luca G. Soave lgs

View GitHub Profile
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@lgs
lgs / bash.sh
Created April 5, 2020 10:38 — forked from antony/bash.sh
Auth0 SSR Compatible Integration with Sapper
npm install --save express express-openid-connect
@lgs
lgs / Count Code lines
Created February 19, 2020 17:42 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@lgs
lgs / Auth.js
Created May 18, 2019 09:24 — forked from kaungmyatlwin/Auth.js
Firebase Vuex Auth Module
import firebase from 'firebase';
const state = {
userId: '',
};
const actions = {
login({ commit, state }, { email, password }) {
return new Promise((resolve, reject) => {
firebase.auth().signInWithEmailAndPassword(email, password)
@lgs
lgs / database.rules.json
Created May 4, 2019 11:31 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@lgs
lgs / README.md
Created April 30, 2019 19:34
Vue + Firebase + Auth Demo

Vue + Firebase + Auth Demo

A simple App using Vue.js & Firebase with Auth.

See the DEMO.

@lgs
lgs / Hide Div When Clicked Outside It
Created April 9, 2019 17:31 — forked from slavapas/Hide Div When Clicked Outside It
Hide Div When Clicked Outside It
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Vanilla Javascript DropDown Menu Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="menu-dropdown">Menu &#9660;</div>
const { setContext } = require('apollo-link-context');
const { HttpLink } = require('apollo-link-http');
const { introspectSchema, makeRemoteExecutableSchema } = require('graphql-tools');
const fetch = require('node-fetch');
module.exports = function(api) {
api.createSchema(async function(graphql) {
const http = new HttpLink({
uri: 'http://example.com/api',
fetch
@lgs
lgs / GitConfigHttpProxy.md
Created August 27, 2018 10:11 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@lgs
lgs / index.js
Created January 16, 2018 13:12 — forked from codediodeio/index.js
Transactional Email Firebase Cloud Function with Sendgrid
var functions = require('firebase-functions');
const sendgrid = require('sendgrid')
const client = sendgrid("YOUR_SG_API_KEY")
function parseBody(body) {
var helper = sendgrid.mail;
var fromEmail = new helper.Email(body.from);
var toEmail = new helper.Email(body.to);
var subject = body.subject;