Skip to content

Instantly share code, notes, and snippets.

View NickWoodhams's full-sized avatar

Nick Woodhams NickWoodhams

View GitHub Profile
@NickWoodhams
NickWoodhams / ssssl.sh
Last active March 30, 2020 17:45
Generates commands to create a self signed ssl that actually works. No browser errors as of 06-25-2019!
#!/bin/bash
# Generates a self signed ssl that actually works
DOMAIN1=$1
DOMAIN2=$4
IP_ADDRESS=$2
SSL_PATH=$3
CNF_PATH="$SSL_PATH/$DOMAIN1.cnf"
KEY_PATH="$SSL_PATH/$DOMAIN1.key"
CRT_PATH="$SSL_PATH/$DOMAIN1.crt"
@NickWoodhams
NickWoodhams / import_xml_override.gs
Created July 3, 2018 00:55
Override Google Limit on IMPORTXML Function in Google Sheets
function importRegex(url, regexInput) {
var output = '';
var fetchedUrl = UrlFetchApp.fetch(url, {muteHttpExceptions: true});
if (fetchedUrl) {
var html = fetchedUrl.getContentText();
if (html.length && regexInput.length) {
output = html.match(new RegExp(regexInput, 'i'))[1];
}
}
// Grace period to not overload
@NickWoodhams
NickWoodhams / push-clipboard-to-iphone.sh
Created March 7, 2018 16:09
Push Clipboard to Phone (Pushover App)
#!/bin/bash
clipboard="message="
clipboard+=$(pbpaste)
curl -s \
--form-string "token=" \
--form-string "user=" \
--form-string "$clipboard" \
https://api.pushover.net/1/messages.json
http://property.phila.gov/?p=341148200
http://property.phila.gov/?p=592073500
http://property.phila.gov/?p=422023800
http://property.phila.gov/?p=112136000
http://property.phila.gov/?p=452311500
http://property.phila.gov/?p=111083800
http://property.phila.gov/?p=364423400
http://property.phila.gov/?p=202215038
http://property.phila.gov/?p=11378300
http://property.phila.gov/?p=871265700
@NickWoodhams
NickWoodhams / random_matrix.py
Last active February 1, 2017 22:01
Generate a tuple with two random ints between 0 and 1000
#! /usr/bin/python
# required library to create a matrix
import numpy
# random int library
from random import randint
from pprint import pprint
@NickWoodhams
NickWoodhams / script.m
Created January 23, 2017 10:59
Generate scatterplot with 2 different colors
data =xlsread('data.xlsx');
vec1 = data (:,1);
vec2 = data (:,2);
mean_vec1 = mean(vec1)
hold on
find(vec1);
find(vec2);
hold on;
@NickWoodhams
NickWoodhams / helpers.py
Created January 12, 2017 18:13
Swap line break characters for div elements you can style. Useful for Displaying Textarea input values.
def nl2lb(value):
return value.replace('\n', '<div class="line-break"></div>')
# Or even simpler
def nl2br(value):
return value.replace('\n', '<br>')
@NickWoodhams
NickWoodhams / create_clover_efi_single_drive.sh
Created December 28, 2016 19:47
Copy Clover installation from /EFI to UEFI partition on target drive. Change disk0 with with your target drive. Find disk number with "diskutil list" command.
#!/bin/sh
sudo newfs_msdos -v EFI -F 32 /dev/rdisk0s1
sudo mkdir /Volumes/EFI
sudo mount -t msdos /dev/disk0s1 /Volumes/EFI
sudo rm -rf /Volumes/EFI/EFI
sudo cp -R /EFI /Volumes/EFI
sudo diskutil unmount /Volumes/EFI
@NickWoodhams
NickWoodhams / config.plist
Created November 27, 2016 23:39
My working X99 Clover config.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>DSDT</key>
<dict>
<key>Debug</key>
<false/>
@NickWoodhams
NickWoodhams / remove_prefs.sh
Created November 14, 2016 10:11
Remove Microsoft Office 2016 Preferences
cd ~/Library/Containers
rm -rf com.microsoft.Excel com.microsoft.Office365ServiceV2 com.microsoft.Outlook com.microsoft.Powerpoint com.microsoft.Word com.microsoft.netlib.shipassertprocess com.microsoft.onenote.mac
rm -rf UBF8T346G9.ms UBF8T346G9.Office UBF8T346G9.OfficeOsfWebHost