Skip to content

Instantly share code, notes, and snippets.

View dotspencer's full-sized avatar

Spencer Smith dotspencer

View GitHub Profile
@dotspencer
dotspencer / change-charset.md
Last active February 18, 2019 18:15
Change mysql database character set (works with Bluehost)

Create database and user on "databases" page accessable from cpanel

Check first

use <database>;
show variables like "character_set_database";

Then open phpMyAdmin and run the following:

ALTER DATABASE db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

@dotspencer
dotspencer / editing-plist.md
Created May 1, 2018 02:16
Allowing insecure (http) request to localhost - XCode iOS project Swift

Open the top level project settings and go to "Info"

Add the following

App Transport Security Settings (as Dictionary)
 `- Exception Domains (as Dictionary)
     `- localhost (as Dictionary)
         `- NSTemporaryExceptionAllowsInsecureHTTPLoads (as Boolean) -- YES
@dotspencer
dotspencer / image-mischief.md
Last active April 26, 2018 17:01
Browser Image Mischief

Source: https://meta.stackexchange.com/a/279664

Changes users page size and sorting preferences (CSRF attack):

<img src="https://meta.stackexchange.com/questions?sort=frequent&pagesize=1">

Freezes page:

@dotspencer
dotspencer / chuch-music-journal.csv
Last active May 16, 2019 05:54
(Sunday) Church Music Journal
Title ID Date
Savior Redeemer of My Soul - Dallyn Bayles & Jenny Oaks Baker AGhxlPAHOg4 4-8-2017
Come Thou Fount - Steven Sharp Nelson -GSv8Cv516U 8-20-2018
For the Beauty of the Earth - Mormon Tabernacle Choir sDnG2Ph21YY 5-15-2019
@dotspencer
dotspencer / read-text.md
Created March 18, 2018 03:26
Read text file from project directory in Swift
let filePath = Bundle.main.path(forResource: "file-name", ofType: "txt")!
let text = try! String(contentsOfFile: filePath)

print(text)

@dotspencer
dotspencer / uuid.js
Last active August 19, 2019 15:23
Simple UUID (GUID) Generator
function uuid() {
const c = () => {
const val = Math.floor(Math.random() * 0x10000).toString(16);
return (`000${val}`).slice(-4); // left pad with zeros
};
const d = '-';
return [c(), c(), d, c(), d, c(), d, c(), d, c(), c(), c()].join('');
}
@dotspencer
dotspencer / wifi.md
Last active September 9, 2018 02:33
Ubuntu Server WiFi

Need to generate wpa-p for /etc/network/interfaces

sudo wpa_passphrase <ssid> <password> >> /etc/network/interfaces

Then edit to match previous values since it added json to the bottom.

Then reboot sudo reboot


@dotspencer
dotspencer / mobile-carrier-list.txt
Last active January 31, 2018 18:35
Mobile Carrier List
Alltel
AT&T
Bell Mobility
BlueGrass Mobile
Boost
Cellcom
Cellular One
Cellular South (Now Cspire)
Centennial
Cingular
@dotspencer
dotspencer / xfinity-devices.csv
Last active June 22, 2021 13:20
Approved Comcast XFINITY Modems and Routers (updated Dec 18, 2017)
Name Description
ARRIS SB8200 Retail Cable Modem
Motorola MB8600 Retail Cable Modem
Netgear C7800 Retail Wireless Gateway
Netgear CM1000 Retail Cable Modem
ARRIS SB6190 Retail SURFboard Cable Modem
ARRIS SBG7580-AC Retail SURFboard Cable Modem And Wi-Fi Router
ASUS CM-32_AC2600 Retail Wireless Gateway
Netgear CM700 Retail Cable Modem
ARRIS SVG2482AC Retail Wireless Gateway with Voice (RDK)
@dotspencer
dotspencer / ddclient-setup.md
Last active December 5, 2017 03:23
DDclient setup