Skip to content

Instantly share code, notes, and snippets.

View BigBlueHat's full-sized avatar
🎩
building Web things

BigBlueHat BigBlueHat

🎩
building Web things
View GitHub Profile
@dlongley
dlongley / transform.js
Created November 15, 2019 16:23
Convert native types
const jsonld = require('jsonld');
const input = {
"@context": {
"@vocab": "http://vocab.example/"
},
"age": {
"@value": "27",
"@type": "http://www.w3.org/2001/XMLSchema#integer"
}
@Ketrel
Ketrel / relBase.html
Last active October 11, 2023 12:17
Relative url base for jekyll
{% assign relBase = '' %}
{% assign tempDepth = page.url | append: 'hackish-solution' | split: '/' | size | minus: 2 %}
{% for i in (1..tempDepth) %}
{% assign relBase = relBase | append: "../" %}
{% endfor %}
{% if relBase == '' %}
{% assign relBase = './' %}
{% endif %}
@boina-n
boina-n / InfoBloxToBind.sh
Created October 22, 2017 15:56
Convert Infoblox zones to Bind Zones
#!/bin/bash
echo "#############################################################"
echo "#############################################################"
echo "## Infoblox to bind export script ##"
echo "## This script should be run on ##"
echo "## a server allowed transfer the zones ##"
echo "## the zones by transfer ##"
echo "#############################################################"
echo "#############################################################"
@Gozala
Gozala / Readme.md
Last active January 12, 2021 13:52
Range hilighting code by wrapping text nodes of the range & replacing images.

Highlight Selection Ranges

Code here takes a DOM Selection Range instance and starts traversing a DOM starting from startContainer up to endContainer and wraps Text elements with elements that have semi-transparent background & swaps img elements with clones that are styled to have semi-transparent yellow overlay.

Issues

  • Only handles selecting text and images & would not cover divs with backgrounds for instance.
@itod
itod / split_keyboards.md
Last active April 24, 2024 16:06
Every "split" mechanical keyboard currently being sold that I know of
@kosamari
kosamari / _ServiceWorker_for_github_pages.md
Last active April 1, 2024 05:44
ServiceWorker for github pages.

ServiceWorker for github pages

This is a ServiceWorker template to turn small github pages into offline ready app.

Why ?

Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.

Notes

Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.

@gkellogg
gkellogg / manifest-model.jsonld
Last active April 25, 2016 12:17
Potential Annotation test harness
{
"@context": "https://github.io/w3c/annotation/testing/context.jsonld",
"id": "manifest-model",
"type": "mf:Manifest",
"label": "Web Annotation Data Model Tests",
"comment": "Runs a battery of test patterns against multiple annotations in JSON-LD format. Each test entry identifies a procedure for generating an annotation, and the results are matched against a set of patterns.",
"entries": [
{
"id": "manifest-model#test001",
"type": "ant:SchemaTest",

URN Resolver API

Many Livefyre APIs use Livefyre URNs as ids of the resources they describe.

The URN Resolver API allows a client to resolve a Livefyre URN to a related URL that describes or manages the resource indicated by the URN.

Use Cases

  • Given knowledge of a Livefyre Collection's Network, Site ID, and Article ID, I can create a link to manage that Collection in Livefyre Studio's web UI.
@Bill
Bill / docker-compose.yml
Last active July 8, 2022 07:10
Run a local Hypothes.is annotation server (and the services it needs) via docker-compose
# This docker-compose.yml will run the Hypothes.is annotation server.
# (adapted from instructions here https://h.readthedocs.org/en/latest/INSTALL.html)
#
# Place this file in the working directory (clone of https://github.com/hypothesis/h)
# run with docker-compose up -d
#
# Now browse to Hypothes.is at http://192.168.59.103:8000/ and create an account
# You'll see the invitation email in Mailcatcher at http://192.168.59.103:1080/
# Click that invitation link and log in on your local Hypothes.is
# And you are ready to annotate!
import json, traceback, requests, types
from collections import defaultdict
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
class HypothesisUtils: