Skip to content

Instantly share code, notes, and snippets.

View dgrebb's full-sized avatar

Dan Grebb dgrebb

View GitHub Profile
@mixin pointer($background, $borderwidth, $bordercolor, $arrowsize, $arrowposition) {
background: $background;
border: $borderwidth solid $bordercolor;
&:after, &:before {
@if $arrowposition == 'top' {
bottom: 100%;
left: 50%;
}
@if $arrowposition == 'bottom' {
top: 100%;
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@dgrebb
dgrebb / AutoHotKey for a Mac User with an Apple keyboard on Windows.ahk
Last active September 18, 2023 18:20 — forked from chrisfcarroll/AutoHotKey for a Mac User with PC keyboard on Windows.ahk
AutoHotKey script for they who, being Mac Users with an Apple keyboard, yet still insist on using Windows. Also some arrange-windows-on-a-big-screen keys . Takes a similar approach as Parallels to keyboard mapping: rather than a wholesale swap of Cmd <-> Ctrl, instead duplicate favourite ctrl-key shortcuts to the Cmd key. For the big screen: som…
#InstallKeybdHook
; Language: English
; https://gist.github.com/chrisfcarroll/dddf32fea1f29e75f564
;
; Uses unicode. Save this file as utf-8 with BOM.
; Else it shall not work.
;
#NoEnv ; Recommended
;SendMode Input ; Recommended
# SYNTAX:
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
# BRACKETS:
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.
@dgrebb
dgrebb / docker-destroy-all.sh
Created April 27, 2019 22:26 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@dgrebb
dgrebb / index.js
Created December 23, 2023 00:25 — forked from tforster/index.js
Naked Redirector CloudFront Function
/**
* @description: Handler entry point.
* - Note AWS CloudFront Functions use a modified ECMAScript 5.1 compatible runtime and NOT NodeJS.
* - Use var, not const or let
* - Use string concatenation and not template literals
* - Beware that the CloudFront Functions Console editor and test environment do NOT mimic CloudFront 100%
* @date 2022-01-26
* @param {object} event: A CloudFront Function event (expecting a Viewer Request event)
* @return {object}: A CloudFront response or request object (depends whether conditions allow pass through or 301 redirect)
*/
@dgrebb
dgrebb / obsidian-web-clipper.js
Last active January 29, 2024 03:01 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@dgrebb
dgrebb / docker-burn.sh
Last active February 21, 2024 23:52 — forked from Jaid/dockerPurge.bash
docker burn
#!/usr/bin/env bash
set -e
set -o errexit
docker stop `docker ps -qa` > /dev/null 2>&1; ## Stop all running containers
docker buildx stop; ## Stop the buildx builder
docker system prune --all --force --volumes; ## Remove all volumes, images, and containers
docker buildx rm --all-inactive --force; ## Remove all buildx builders
docker buildx prune --all --force; ## Prune buildx builder caches