Skip to content

Instantly share code, notes, and snippets.

Luca G. Soave lgs

View GitHub Profile
View 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>
View Importing Remote GraphQL Schema into Gridsome
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 Aug 27, 2018 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy
View GitConfigHttpProxy.md

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 Jan 16, 2018 — forked from codediodeio/index.js
Transactional Email Firebase Cloud Function with Sendgrid
View index.js
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;
@lgs
lgs / graphql.js
Created Dec 27, 2017 — forked from websoftwares/graphql.js
Getting GraphQL on webtask.io running
View graphql.js
'use latest'
const express = require('express')
const graphqlHTTP = require('express-graphql')
const { buildSchema } = require('graphql')
const app = express()
const webtask = require('webtask-tools')
const bodyParser = require('body-parser')
const schema = buildSchema(`
type Query {
@lgs
lgs / mailchimp-subscribe.coffee
Created Dec 12, 2017 — forked from chrsgrffth/mailchimp-subscribe.coffee
Vue – Mailchimp Subscribe Component
View mailchimp-subscribe.coffee
# To get the `action` prop:
#
# 1. Go to your dashboard on mailchimp.com and navigate
# to Lists > Signup Forms > Embedded Forms.
#
# 2. Copy the `<form>` action from the generated HTML code.
#
# 3. Pass that into the component via the prop, like so:
#
# <mailchimp-subscribe
@lgs
lgs / index.js
Created Oct 26, 2017 — forked from codediodeio/index.js
Simple Stripe Payments with Firebase Cloud Functions
View index.js
const functions = require('firebase-functions')
const admin = require('firebase-admin')
admin.initializeApp(functions.config().firebase);
const stripe = require('stripe')(functions.config().stripe.testkey)
exports.stripeCharge = functions.database
@lgs
lgs / feedly_api.md
Created Sep 28, 2017 — forked from d3m3vilurr/feedly_api.md
Unofficial Feedly API Document
View feedly_api.md

IDs

  • user_id - user/:uid
  • feed_id - feed/:feed_uri
  • category_id - :user_id/category/:category (special category: global.all, global.uncategorized)
  • tag_id - :user_id/tag/:tag (special tag: global.saved)

APIs

http://cloud.feedly.com/:version/:api

@lgs
lgs / README.md
Created Sep 17, 2017 — forked from stursby/README.md
Vue + Firebase + Auth Demo
View README.md

Vue + Firebase + Auth Demo

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

See the DEMO.

@lgs
lgs / s3staticsite_route53a.tf
Created Aug 25, 2017 — forked from cliffano/s3staticsite_route53a.tf
Terraform configuration for setting up S3 static site bucket with a Route53 A record.
View s3staticsite_route53a.tf
variable "bucket_site" {}
variable "region" {}
variable "route53_domain_name" {}
variable "route53_domain_zoneid" {}
variable "route53_domain_alias_name" {}
variable "route53_domain_alias_zoneid" {}
provider "aws" {
region = "${var.region}"
}
You can’t perform that action at this time.