Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
craigmdennis / update.sh
Created September 26, 2023 20:06
Update Cloudflare Access Group IP address based on current public IP address from the requestor
ACCOUNT_ID="YOUR_ACCOUNT_ID"
GROUP_ID="YOUR_ACCESS_GROUP_ID"
GROUP_NAME="YOUR_ACCESS_GROUP_NAME"
API_TOKEN="YOUR_CLOUDFLARE_API_KEY"
IP_ADDRESS=$(curl -s https://api.ipify.org)
curl --request PUT \
--url https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/groups/$GROUP_ID \
--header 'Content-Type: application/json' \
@craigmdennis
craigmdennis / devtools.js
Last active May 7, 2020 11:59
Create a comma separated string of the text from a series of nodes using devtools
let comma = ''; for (const cf of document.querySelectorAll('.class a')) { comma += `${cf.innerHTML},` }; console.log(comma);
@craigmdennis
craigmdennis / backslash.json
Created January 30, 2019 23:08
Karabiner: Change the backslash key to be delete unless it's held down, then show backslash as normal.
{
"title": "Backslash to Delete Unless Held",
"rules": [
{
"description": "Change the backslash key to be delete unless it's held down, then show backslash as normal.",
"manipulators": [
{
"from": {
"key_code": "backslash"
},
@craigmdennis
craigmdennis / svgo.json
Last active May 16, 2023 16:46
SVGo Sketch Plugin Configuration
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": true,
"indent": 2,
"floatPrecision": 3,
"plugins": [
{
"name": "removeDoctype",
"enabled": true
},
@craigmdennis
craigmdennis / post-merge
Last active March 21, 2017 14:03 — forked from sindresorhus/post-merge
Git hook to run a command after `git pull` if a specified file was changed
#!/usr/bin/env bash
# GIT hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
@craigmdennis
craigmdennis / index.pug
Created January 3, 2017 00:22
Pass objects into Pug mixins for default arguments
include mixin.pug
+navigation_li('Anchor text here', {
a_class: 'c-main-navigation__link',
li_class: 'active'
})
+navigation_li('More anchor text here', {
a_class: 'c-main-navigation__link'
})
@craigmdennis
craigmdennis / build-before.yml
Last active September 30, 2019 13:56
Configure Circle CI to deploy Trellis
- name: Run npm install
command: npm install
connection: local
args:
chdir: "{{ project.local_path }}/web/app"
tags: skip-using-ci
- name: Rebuild Node Sass
command: npm rebuild node-sass
connection: local
@craigmdennis
craigmdennis / multiple_ssh_setting.md
Last active December 10, 2016 00:14 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@craigmdennis
craigmdennis / _tools_fonts.scss
Last active January 25, 2018 16:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$font-name: 'GT-Walsheim';
$font-path: '../fonts/';
$weights: (
400 'Regular',
{
"auto_indent": true,
"binary_file_patterns":
[
"*.bz2",
"*.dds",
"*.eot",
"*.gif",
"*.gz",
"*.ico",