Skip to content

Instantly share code, notes, and snippets.

View j0lvera's full-sized avatar
🎯
Focusing

Juan Olvera j0lvera

🎯
Focusing
View GitHub Profile
@j0lvera
j0lvera / Readme.md
Created October 12, 2019 20:19 — forked from colllin/Readme.md
FaunaDB User Token Expiration (for ABAC)

Auth0 + FaunaDB ABAC integration: How to expire Fauna user secrets.

Fauna doesn't yet provide expiration/TTL for ABAC tokens, so we need to implement it ourselves.

What's in the box?

3 javascript functions, each of which can be imported into your project or run from the command-line using node path/to/script.js arg1 arg2 ... argN:

  1. deploy-schema.js: a javascript function for creating supporting collections and indexes in your Fauna database.
@j0lvera
j0lvera / pylintrc
Created July 25, 2017 19:28
pylintrc
[MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
@j0lvera
j0lvera / search_index.json
Last active July 6, 2017 06:00
WHATWG Search index in Python
[{"text": "Introduction", "section": "1", "uri": "introduction.html#introduction"}, {"text": "Is this HTML5?", "section": "1.1 - Introduction", "uri": "introduction.html#is-this-html5?"}, {"text": "Background", "section": "1.2 - Introduction", "uri": "introduction.html#background"}, {"text": "Audience", "section": "1.3 - Introduction", "uri": "introduction.html#audience"}, {"text": "Scope", "section": "1.4 - Introduction", "uri": "introduction.html#scope"}, {"text": "History", "section": "1.5 - Introduction", "uri": "introduction.html#history-2"}, {"text": "Design notes", "section": "1.6 - Introduction", "uri": "introduction.html#design-notes"}, {"text": "Compliance with other specifications", "section": "1.6.1 - Design notes", "uri": "introduction.html#compliance-with-other-specifications"}, {"text": "Extensibility", "section": "1.6.2 - Design notes", "uri": "introduction.html#extensibility"}, {"text": "HTML vs XML syntax", "section": "1.7 - Introduction", "uri": "introduction.html#html-vs-xhtml"}, {"text":
@j0lvera
j0lvera / commands.md
Last active July 3, 2017 02:54
npm installs for laravel-mix
npm init
npm i laravel-mix cross-env node-sass -D
npm i react react-dom -S
  • Create webpack.mix.js
  • Paste scripts in package.js
@j0lvera
j0lvera / laravel-mix-scripts.js
Created July 3, 2017 02:47
laravel-mix npm scripts
{
"dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
}
@j0lvera
j0lvera / keybase.md
Created June 23, 2017 16:16
keybase.md

Keybase proof

I hereby claim:

  • I am thinkxl on github.
  • I am thinkxl (https://keybase.io/thinkxl) on keybase.
  • I have a public key ASAbrK8cv-npVMgCkqe0wxB1TsXpsxEp3F9vqCmfQpma1wo

To claim this, I am signing this object:

@j0lvera
j0lvera / bottle-cors.py
Created October 29, 2016 04:28 — forked from richard-flosi/bottle-cors.py
Bottle with Cross-origin resource sharing (CORS)
"""
Example of setting up CORS with Bottle.py.
"""
from bottle import Bottle, request, response, run
app = Bottle()
@app.hook('after_request')
def enable_cors():
"""
@j0lvera
j0lvera / index.html
Last active October 25, 2016 00:47
HTML example
<!DOCTYPE html>
<html>
<head>
<title>Home page</title>
</head>
<body>
<header>
<nav>
<a href="index.html">Home Page</a>
<a href="about.html">About</a>
@j0lvera
j0lvera / bower-style-guide.md
Last active December 2, 2015 23:02
Bower Style Guide

Bower's Style Guide

Description

This is a living document with coding conventions and rules to improve the writing and design of the Bower codebase.

All code in any code-base should look like a single person typed it, no matter how many people contributed. – Principles of Writing Consistent, Idiomatic JavaScript

Bower's code style stays true to convention, while still allowing for flexibility. When contributing, you should write your code following Bower's style.