Skip to content

Instantly share code, notes, and snippets.

View piersolenski's full-sized avatar
💤
Sleeping

Piers Olenski piersolenski

💤
Sleeping
View GitHub Profile
@snorrees
snorrees / collectionUpdate.ts
Created March 15, 2023 14:33
Sanity Connect custom handler. See requirements.md
import type {SanityClient} from '@sanity/client'
import {v5 as uuidv5} from 'uuid'
import {buildCollectionDocumentId, commitCollectionDocument} from './sanityOps'
import type {ShopifyDocumentCollection} from './storageTypes'
import {SHOPIFY_COLLECTION_DOCUMENT_TYPE, UUID_NAMESPACE_COLLECTIONS} from './constants'
import {DataSinkCollection} from './requestTypes'
import {idFromGid} from './requestHelpers'
@EllyLoel
EllyLoel / reset.css
Last active June 28, 2024 04:00
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/

Simple journal with vim

So how would you use your text editor to make a daily notes?

For vim I end up using simple approach:

  • have a ~/docs/journal/ directory where I keep yearly journals in asciidoc format (one can use markdown of course).

  • have a mapping to quickly open a journal ready to enter you thoughts, notes or a todos for a day.

@vasanthk
vasanthk / AgileContractGuide.md
Created July 19, 2020 20:46 — forked from RobRuana/AgileContractGuide.md
Agile Contract Guide

Agile Contract Guide

This document is a guide to writing agile contracts. Unlike traditional contracts, an agile contract does not specify individual tasks to be completed by the Contractor. Rather, an agile contract specifies how the Client and Contractor interact, and how the Contractor is paid. The Deliverable Work performed for the contract is determined through an ongoing collaboration between the Client and the Contractor.

Agile contracts require a great deal of trust from both the Client and the Contractor. This trust is fostered through tight feedback cycles and well-defined responsibilities that both parties can expect from each other. More so than traditional contracts, an agile contract requires active participation from the Client.

@narze
narze / karabiner.json
Created November 25, 2019 06:46
karabiner.json from my goku
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@3mw-support
3mw-support / Smooth Auto-Scroll Webpage for Screen Capture Videos & Gifs
Created December 20, 2018 18:47
Use this gist if you want to record smooth-scrolling screen capture videos and/or gifs.
javascript:(function(n,t){t['true']=n;var i=function(n,t,i){var r=n.style;r.webkitTransition=r.transition=i+'s';r.webkitTransitionTimingFunction=r.TransitionTimingFunction='ease-in-out';r.webkitTransform=r.Transform='translate3d(0, '+-t+'px, 0)'};var r=function(){var n=[].slice.call(arguments);var t=n.shift(),i=n.shift(),r=n;setTimeout(function(){i.apply(null,r)},t*1e3)};var e=function(n,t,i,e){r(t,o,i,e)};var a=document.getElementsByTagName('body')[0];var o=i.bind(null,a);var s=e.bind(null,a);var l=function(n){var t='Enter delay (in seconds), distance to scroll (in pixels) and the scroll duration (in seconds).\n\nRun the script a second time with options 0 0 0 to reset the page.\n\nExample:\n\n1 800 5';if(n){t=n+'\n\n'+t}var i=prompt(t);if(i===null){return}if(/\d{1,} \d{1,} \d{1,}/.test(i)){return i.split(' ')}return l('Woops. Input invalid: '+i)};var u=function(){var n=l();if(n){s.apply(null,n)}};u()})({},function(){return this}());
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@SamJakob
SamJakob / smoothscroll.js
Created October 22, 2018 17:10
A vue-js supported smooth-scroll module based on a Stack Overflow answer by Manuel Otto.
const SmoothScroll = (target, speed, smooth) => {
if (target === document)
target = (document.documentElement || document.body.parentNode || document.body) // cross browser support for document scrolling
let moving = false;
let pos = target.scrollTop;
target.addEventListener('mousewheel', scrolled, false)
/* target.addEventListener('DOMMouseScroll', scrolled, false) */
function scrolled(e) {
@RobRuana
RobRuana / AgileContractGuide.md
Last active October 1, 2023 17:41
Agile Contract Guide

Agile Contract Guide

This document is a guide to writing agile contracts. Unlike traditional contracts, an agile contract does not specify individual tasks to be completed by the Contractor. Rather, an agile contract specifies how the Client and Contractor interact, and how the Contractor is paid. The Deliverable Work performed for the contract is determined through an ongoing collaboration between the Client and the Contractor.

Agile contracts require a great deal of trust from both the Client and the Contractor. This trust is fostered through tight feedback cycles and well-defined responsibilities that both parties can expect from each other. More so than traditional contracts, an agile contract requires active participation from the Client.

@crittermike
crittermike / wget.sh
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.