Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Carry pixelastic

View GitHub Profile
@pixelastic
pixelastic / custom-token.js
Created Jul 2, 2018
Firebase function to return an Auth0 custom token
View custom-token.js
import cors from 'cors';
import Promise from 'bluebird';
import axios from 'axios';
import database from '../database/database.js';
/**
* The goal of this function is to mint custom token that can be used to
* authenticate to Firebase.
* The function will be called through https, and will check the credentials of
* the requested user (through the usage of its Auth0 token). If the Auth0 token
@pixelastic
pixelastic / data.json
Last active Apr 30, 2018
Staticgen data
View data.json
{"wspringer/monkeyman":{"17651":{"size":1275,"stargazers_count":48,"watchers_count":48,"forks_count":15,"open_issues_count":5,"forks":15,"open_issues":5,"watchers":48,"network_count":15,"subscribers_count":9}},"interstar/bootdown":{"17651":{"size":1369,"stargazers_count":7,"watchers_count":7,"forks_count":2,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":7,"network_count":2,"subscribers_count":1}},"adamrenklint/asimov-static":{"17651":{"size":766,"stargazers_count":4,"watchers_count":4,"forks_count":4,"open_issues_count":0,"forks":4,"open_issues":0,"watchers":4,"network_count":4,"subscribers_count":2}},"waferbaby/dimples":{"17651":{"size":561,"stargazers_count":54,"watchers_count":54,"forks_count":7,"open_issues_count":0,"forks":7,"open_issues":0,"watchers":54,"network_count":7,"subscribers_count":3}},"mkdocs/mkdocs":{"17651":{"size":23313,"stargazers_count":5528,"watchers_count":5528,"forks_count":865,"open_issues_count":97,"forks":865,"open_issues":97,"watchers":5528,"network_count":865,"subscrib
View matching-keywords.scss
// Show only for matching keywords
input[value="alexandre" i] ~ #results #result15,
input[value="alexandre" i] ~ #results #result16,
input[value="alexandre" i] ~ #results #result17 {
display: block
}
View several-results.scss
// Pre-fill the content
#result0:before { content: "Aurora Pleguezelo" }
// […]
#result15:before { content: "Alexandre Collin" }
#result16:before { content: "Alexandre Meunier" }
#result17:before { content: "Alexandre Stanislawski" }
// […]
#result150:before { content: "Zo Asmail" }
// Hide them all
#results div { display: none }
View several-results.html
<!-- one div per employee -->
<div id="results">
<div id="result0"></div>
<div id="result1"></div>
<div id="result2"></div>
[…]
<div id="result148"></div>
<div id="result149"></div>
<div id="result150"></div>
</div>
View oninput.html
<input type="search" value=""
oninput="this.setAttribute('value', this.value)"
/>
View basic-selector.scss
input[value="tim" i] ~ #result:before {
content: "Tim Carry";
}
View basic-markup.html
<input type="search" value="Tim" />
<div id="result"></div>
@pixelastic
pixelastic / basic-markup.html
Created Jan 9, 2018
A Search Engine in CSS
View basic-markup.html
<input type="search" value="Tim" />
<div id="result"></div>
@pixelastic
pixelastic / Answers
Last active Jan 9, 2018 — forked from aymorgan/Introduction
Guidance for implementing Algolia.generate_secured_api_key
View Answers
# Answer
Thanks for the question, I'll do my best to guide you the best way I can.
I think you're very close to have a working implementation.
Algolia secured API keys are API keys with *hard* filters already embedded
inside. You generic Search API key will let you search through all the content
in your index, but when you create a secured API key, you create a specific
version of your search API key that can only search into a subset of records.