This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
-- Adapted from https://github.com/PaperKup/csv-toicloudkeychain | |
-- For macOS Big Sur | |
-- Select the csv to import to iCloud keychain | |
-- Expects a CSV without headers and the following format: | |
-- WEBSITE,USERNAME,PASSWORD | |
set theFile to (choose file with prompt "Select the CSV file") | |
-- Read csv file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/unbound/unbound.conf.d/pi-hole.conf | |
server: | |
# If no logfile is specified, syslog is used | |
# logfile: "/var/log/unbound/unbound.log" | |
verbosity: 0 | |
interface: 127.0.0.1 | |
port: 5335 | |
do-ip4: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
--Variables | |
set vpnServer to "vpn.mydomain.com" | |
set vpnPassword to "myb64pwd" | |
set vpnAppBundleName to "Cisco AnyConnect Secure Mobility Client" | |
set vpnAppBundleId to "com.cisco.anyconnect.gui" | |
set keyCodeDelete to 51 | |
set keyCodeReturn to 36 | |
set tinyDelay to 1 | |
set smallDelay to 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Browser hacks | |
/// Source: browser strangeness | |
/// https://browserstrangeness.github.io/css_hacks.html | |
/// Jeff Clayton | |
/// @access public | |
/// @param {String} $browser | |
/// @param {String} $selector | |
/// @param {String} $property | |
/// @param {*} $value | |
/// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseUrl(url = '') { | |
// Make it compatible with the URL() constructor | |
const parsed = { | |
href: '', | |
origin: '', | |
protocol: '', | |
username: '', | |
password: '', | |
host: '', | |
hostname: '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# Interactive Git Checkout | |
# ------------------------------------------------------------------------------ | |
# Author: Joao Carmo | |
# License: MIT | |
# ------------------------------------------------------------------------------ | |
# This script will list all available local branches and you can select one to | |
# checkout using a number (on the list). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# Interactive Git Delete | |
# ------------------------------------------------------------------------------ | |
# Author: Joao Carmo | |
# License: MIT | |
# ------------------------------------------------------------------------------ | |
# This script will list all available local branches and you can select one or | |
# more to delete using numbers (from the list). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Preview as HTML in Chrome", | |
"type": "shell", | |
"osx": { | |
"command": "cp ${file} /tmp/${fileBasename}_preview.html && /Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome /tmp/${fileBasename}_preview.html && sleep 5 && rm -f /tmp/${fileBasename}_preview.html", | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
################################################################################ | |
# Python Wrapper | |
# ------------------------------------------------------------------------------ | |
# Author: Joao Carmo | |
# License: MIT | |
# ------------------------------------------------------------------------------ | |
# This wrapper script will test each available Python interpreter in the system | |
# to find the one which has the most critical modules installed and then execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Usage: setNestedValue(<object>, <array>, <value>) | |
const object = { | |
key1: { | |
key11: 'nested-value' | |
} | |
} | |
const newObject = setNestedValue(object, ['key1', 'key12'], 'another-nested-value') |
NewerOlder