Skip to content

Instantly share code, notes, and snippets.

View nybatista's full-sized avatar

Frank Batista nybatista

View GitHub Profile
@nybatista
nybatista / states_hash.json
Created July 23, 2020 02:46 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@nybatista
nybatista / build-lunrjs-index.js
Created January 26, 2020 18:14 — forked from HugoDF/LICENSE.md
Integrate lunrjs with a Hugo (gohugo.io) site.
const fs = require('fs').promises;
const {promisify} = require('util');
const frontMatterParser = require('parser-front-matter');
const parse = promisify(frontMatterParser.parse.bind(frontMatterParser));
async function loadPostsWithFrontMatter(postsDirectoryPath) {
const postNames = await fs.readdir(postsDirectoryPath);
const posts = await Promise.all(
postNames.map(async fileName => {
@nybatista
nybatista / Instructions.md
Created August 29, 2018 00:29 — forked from pgilad/Instructions.md
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@nybatista
nybatista / host.js
Created January 4, 2018 19:16 — forked from tuan/host.js
RxJs and window's postMessage for intercommunication
import * as Rx from "rxjs/Rx";
import * as uuid from "uuid";
import {IRequest} from "./common";
let button = document.querySelector("button");
let iframe = document.createElement("iframe");
iframe.src = "/proxy.html";
document.body.appendChild(iframe);