Skip to content

Instantly share code, notes, and snippets.

View jarrodoxical's full-sized avatar
💯

Jarrod Oxical jarrodoxical

💯
View GitHub Profile
@myfonj
myfonj / calendar.html
Last active June 30, 2022 05:25 — forked from erkiesken/calendar.html
compact calendar
<html>
<body>
<style>
.month {
--unit: 1.25rem;
padding-left: calc(var(--firstWeekDay) * var(--unit));
}
.day {
display: inline-block;
width: var(--unit);
@pesterhazy
pesterhazy / github-print.md
Last active July 10, 2022 04:52
Print Github Markdown

I often want to read Markdown documentation on Github — or proof-read my own documents — without staring at a backlit screen. Here's an easy way to print the files in a readable format.

  1. Create a bookmarklet with the following code and give it the name "github print"

    javascript:void function(){b=document.body,c=document.querySelector("article"),b.innerHTML="",b.appendChild(c)}();
    
  2. Go to the markdown view on Github of the file you want to print, e.g. Ripgrep's user guide

  3. Click on the bookmarklet. Alternatively (in Chrome) type "github print" in the search bar, select the bookmarklet code with cursor keys if necessary and press enter.

  4. Use the browser print feature to print the document, to a physical printer or (to save paper) to PDF on a reMarkable eInk tablet.

@adulau
adulau / hashlookup-circl-lu.md
Last active September 3, 2024 17:03
hashlookup.circl.lu - examples

hashlookup.circl.lu

CIRCL hash lookup is a public API to lookup hash values against known database of files. NSRL RDS database is included. More database will be included in the future. The API is accessible via HTTP ReST API and the API is also described as an OpenAPI.

Get information about the hash lookup database (via ReST)

curl -X 'GET' \
  'https://hashlookup.circl.lu/info' \
 -H 'accept: application/json'
@adam-james-v
adam-james-v / vidwiz.clj
Last active January 22, 2023 09:42
Clojure/babashka script to help automate some of my video editing pipeline
#!/usr/bin/env bb
(ns vidwiz.main
"This is a prototype script for automating a portion of my video editing using ffmpeg."
(:require [clojure.java.shell :refer [sh]]
[clojure.string :as st]
[cheshire.core :refer [parse-string]]))
;; util
(defn get-extension
@StanBright
StanBright / domain_check.sh
Last active July 23, 2021 04:26
Domain Name Search
#!/bin/bash
# Name: Check for domain name availability (as featured on https://stanbright.com/domain-name-search)
#
# To use this script, add it to your ~/bin directory and make it executable.
# Then you can search for specific domains like this: > domain_check.sh my-new-domain
#
# Alternatively:
# - Generate domain name ideas based on a keyword: https://www.saashub.com/namebounce-alternatives
# - Search domain names as you type: https://www.saashub.com/domaintyper-alternatives
#!/usr/bin/env python
import math
import sys
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb)
# Assumes x1 < x2, y1 < y2
@lcfd
lcfd / hn.ts
Last active September 29, 2020 22:22
import * as colors from "https://deno.land/std/fmt/colors.ts";
const BASE_PATH = "https://hacker-news.firebaseio.com/v0/";
const get_top_stories = async () => {
console.info(
`
/$$ /$$ /$$ /$$ /$$
| $$ | $$ | $$ | $$$ | $$
| $$ | $$ /$$$$$$ /$$$$$$$| $$ /$$ /$$$$$$ /$$$$$$ | $$$$| $$ /$$$$$$ /$$ /$$ /$$ /$$$$$$$

This is probably going to be the next iteration of the declarative CRUD metamodel that powers Hyperfiddle. It's just a design sketch, the current metamodel in prod is different. Hyperfiddle is an easy way to make a CRUD app. Hyperfiddle is based on Datomic, a simple graph database with the goal of "enabling declarative data programming in applications."

CRUD UI definition

This extends Datomic pull syntax into something that composes in richer ways. The key idea is that Pull notation expresses implicit joins and thus can be used to declare data dependencies implicitly, without needing to name them. We also handle tempids, named transactions, and hyperlinks to other pages. We satisfy the hypermedia constraint, like HTML and the web.

{identity                                                   ; Pass through URL params to query
 [{:dustingetz/event-registration                           ; virtual attribute identif
@armand1m
armand1m / nominatim-geocoder.ts
Last active June 19, 2019 07:46
Geocoder Implementation using OSM Nominatim
import fetch from "node-fetch";
interface Location {
place_id: number;
licence: string;
osm_type: string;
osm_id: number;
boundingbox: string[];
lat: string;
lon: string;
@agibsonsw
agibsonsw / gist:a993c14ee172dfeb4d96
Created January 8, 2016 22:11
Bookmarklet to highlight selected word
javascript: (function() {
var els, i, txt = "";
if (window.getSelection) {
txt = window.getSelection();
} else if (document.getSelection) {
txt = document.getSelection();
} else if (document.selection) {
txt = document.selection.createRange().text;
} else {
txt = "";