Skip to content

Instantly share code, notes, and snippets.

View charrismatic's full-sized avatar
☝️
Life is Code

Matt Harris charrismatic

☝️
Life is Code
View GitHub Profile
@charrismatic
charrismatic / .editorconfig
Last active April 1, 2020 09:11
Atom Sync Settings [Master]
# .editorconfig (not found)
@charrismatic
charrismatic / regex_list.js
Last active August 4, 2023 07:11
Useful Regex String List
regexLib = {
multiLineCComments: a("/\\*.*?\\*/", "gs"),
singleLineCComments: /\/\/.*$/gm,
singleLinePerlComments: /#.*$/gm,
doubleQuotedString: /"([^\\"\n]|\\.)*"/g,
singleQuotedString: /'([^\\'\n]|\\.)*'/g,
multiLineDoubleQuotedString: a('"([^\\\\"]|\\\\.)*"', "gs"),
multiLineSingleQuotedString: a("'([^\\\\']|\\\\.)*'", "gs"),
xmlComments: a("(&lt;|<)!--f.*?--(&gt;|>)", "gs"),
url: /\w+:\/\/[\w-.\/?%&=:@;#]*/g,
@charrismatic
charrismatic / vanilla_data.js
Last active July 19, 2017 02:39
Vanilla Tools Js
/***************************************************************************/
// Vanilla Javascript Data Gathering
// Used to collect data without using a framework or library tools
// TODO: Get all X on a page (img url, a href, script src etc)
// REF: https://drafts.csswg.org/cssom/
// GET ALL IDS ON PAGE
function getAllIds() {
@charrismatic
charrismatic / spotify_cli.sh
Last active July 7, 2017 00:02
Spotify API - Keep computer awake if currently playing
# Machine currently playing goes into sleep mode during playback
# A simple curl request to see if this machine is currently active
# If true reset wake timer and set timer to run again at t-1 wake timer
# Hooks: Run script at spotify application launch and run at machine wake
# https://developer.spotify.com/web-api/endpoint-reference/
# ref: https://developer.spotify.com/web-api/console/get-user-player/
# example:
curl -X GET "https://api.spotify.com/v1/me/player" -H "Accept: application/json" -H "Authorization: Bearer <API-KEY>"