Skip to content

Instantly share code, notes, and snippets.

View kristoferjoseph's full-sized avatar
🐘
💨

kj kristoferjoseph

🐘
💨
View GitHub Profile
@kristoferjoseph
kristoferjoseph / gist:31643839117acf165273e3eac40ba5fa
Created November 26, 2020 21:38
Updated and sprankled Hemisu dark theme for Highlightjs
/* Hemisu Dark */
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #282a36;
}
.hljs-comment,
.hljs-meta {
// THIS
```javascript
// NOT THIS
``` javascript
@kristoferjoseph
kristoferjoseph / gh-orgs-pagination.html
Last active October 7, 2020 18:48
List all repos for an organization using the GitHub API and pagination Link header.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>GET ALL REPOS</title>
<style>
* {
margin:0;
padding:0;
box-sizing: border-box;
@kristoferjoseph
kristoferjoseph / nested-components.js
Created July 22, 2020 16:56
Wishlist fot SSR html from tagged template literal
import html from 'super-cool-lib.js'
import child from './child.js'
export default function Parent(props) {
return html`
<x-parent>
<x-child></x-child>
</x-parent>
`
}
@kristoferjoseph
kristoferjoseph / watch.ts
Last active May 4, 2022 19:33
deno file watcher test runner
import { exec } from "https://deno.land/x/exec/mod.ts";
const watcher = Deno.watchFs("./");
for await (const event of watcher) {
// if you're curious
// let kind = event.kind
// console.log('EVENT KIND: ', kind)
await exec('clear')
await exec('deno test --allow-read')
}
@kristoferjoseph
kristoferjoseph / dam-accordion.html
Created March 11, 2020 04:20
Dam Accordian Web Component
<template id="dam-accordian-template">
<style>
:host {
display: flex;
flex-direction: column;
font-family: sans-serif;
border: 1px solid #DDD;
border-radius: 2px;
box-shadow: 0 1px 2px rgba(0,0,0,0.25);
transition: box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
@kristoferjoseph
kristoferjoseph / dam-counter.html
Created March 10, 2020 03:17
Stock JavaScript Web Component Counter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dam Counter</title>
</head>
<body>
<template id="dam-count-template">
<button class="dam-count-btn"></button>
</template>
@kristoferjoseph
kristoferjoseph / index.html
Created December 4, 2019 19:38
Preact hooks example: useReducer, useEffect. No compile step.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
*,
*:before,
*:after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 16px;
@kristoferjoseph
kristoferjoseph / HTML-template.js
Created October 15, 2019 18:30
Html template ( outer wrapper )
export default function Layout (props) {
props = props || {}
let title = props.title || ''
let content = props.content || ''
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1">