Skip to content

Instantly share code, notes, and snippets.

View oDinZu's full-sized avatar
💭
"The greatest is space, for it holds all things." ~Thales of Miletus

oDinZu WenKi oDinZu

💭
"The greatest is space, for it holds all things." ~Thales of Miletus
View GitHub Profile
@MichaelCurrin
MichaelCurrin / README.md
Last active March 12, 2023 19:40
Render content for all Jekyll pages as a single JSON endpoint

Make a REST API with Jekyll

Render content for all your Jekyll pages as a single JSON endpoint

How it works

The JSON Liquid file below uses all pages in the site and renders their content.

The output is a map or hash. It uses the page's URL as the key. And the content as plain text (no markdown or HMTL) for the value.

@MichaelCurrin
MichaelCurrin / README.md
Last active October 26, 2023 18:47
Jekyll - how to build a REST API

Jekyll - how to build a REST API

Serve your data as static JSON

How to make a read-only JSON REST API using Jekyll.

This doesn't need any Ruby plugins - you just use some built-in templating features in Jekyll 3 or 4.

You will end up with a single JSON file contains data for all pages on the site, and another JSON file of just posts. Alternatively, you can replace every HTML page and post with a JSON version.

@leto
leto / btch_fullnode.md
Last active January 30, 2018 12:14
Bitcoin Hush Full Node instructions

Bitcoin Hush is actually a Komodo Asset chain, so we need to download and compile that code, which will allow us to connect to the BTCH network. We must tell it a node to connect to that knows about the BTCH asset chain.

BTCH uses RPC port 10161 and a P2P port of 10160, you might need to allow them in your firewall.

  git clone https://github.com/jl777/komodo
  cd komodo
  # This needs to download the Zcash Proving key, around ~1GB file
  ./zcutil/fetch-params.sh
SHELL := /bin/bash
YARN := yarn
VENDOR_DIR = assets/vendor/
JEKYLL := jekyll
PROJECT_DEPS := package.json
.PHONY: all clean install update
all : serve
@ambroisemaupate
ambroisemaupate / security.conf
Last active April 5, 2024 14:38
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx