Skip to content

Instantly share code, notes, and snippets.

☕️
Probably drinking coffee.

Justin O'Boyle justinoboyle

☕️
Probably drinking coffee.
Block or report user

Report or block justinoboyle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@justinoboyle
justinoboyle / Google Tasks Unlocker.js
Created Sep 23, 2019
Google Tasks Unlocker UserScript
View Google Tasks Unlocker.js
// ==UserScript==
// @name google tasks
// @match https://tasks.google.com/*
// @grant none
// ==/UserScript==
// Just go to tasks.google.com. Installing as a shortcut works too.
if(Object.values(document.getElementsByTagName('p')).map(a=>a.innerText).join(' ').includes('The requested URL was not found on this server. '))
window.location.href="https://tasks.google.com/embed/?origin=https://calendar.google.com&fullWidth=1"
var s = document.createElement('style');
s.textContent = 'body { display: inline !important }';
View error.log
✘  ~  php php7cc.phar /run/user/1000/gvfs/REDACTED/wp-content/themes/AttorneyTheme/
File: /run/user/1000/gvfs/REDACTED/wp-content/themes/AttorneyTheme/inc/blog-functions.php
> Line 248: Possible internal array pointer access/modification in a by-value foreach loop
current($attachment_ids);
File: /run/user/1000/gvfs/REDACTED/wp-content/themes/AttorneyTheme/vendor/import/offline/attorney-importer.php
> Line 19: Removed function "mysql_connect" called
mysql_connect($host, $uname, $dbpass);
@justinoboyle
justinoboyle / arduino-script.js
Last active Mar 26, 2019
Arduino Song Code Generator - This Node.JS script takes an input file of piano notation and converts it into valid C++ code
View arduino-script.js
/**
* Arduino Song Code Generator - by Justin O'Boyle
* https://github.com/justinoboyle
* justin@justinoboyle.com
*
* This Node.JS script takes an input file of piano notation (I used notation from pianoletternotes.blogspot.com) and converts it into valid C++ code.
*
* Usage:
* node arduino-script.js # Uses bars.txt as input
*
@justinoboyle
justinoboyle / nyc-neighborhoods.json
Created Feb 25, 2019
New York City Neighborhoods by Zip Code
View nyc-neighborhoods.json
{
"10012": "SoHo, Mn",
"10013": "Greenwich Village, Mn",
"10014": "West Village, Mn",
"10004": "Bowling Green, Mn",
"10005": "Financial District, Mn",
"10006": "Battery Park City, Mn",
"10007": "City Hall, Mn",
"10038": "Battery Park City, Mn",
"10002": "Lower East Side, Mn",
View zshandroid.sh
main() {
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
View exec-mac-app.sh
# add to .*rc
eval $(node -e "eval(new Buffer('bGV0IHsgcmVhZGRpclN5bmMgfSA9IHJlcXVpcmUoJ2ZzJyksIHsgam9pbiB9ID0gcmVxdWlyZSgncGF0aCcpOyBkaXJlY3RvcmllcyA9IFsgJy9BcHBsaWNhdGlvbnMvJywgJy9BcHBsaWNhdGlvbnMvVXRpbGl0aWVzJyBdO2RpcmVjdG9yaWVzLmZvckVhY2goZGlyID0+IHJlYWRkaXJTeW5jKGRpcikuZmlsdGVyKGEgPT4gYS5lbmRzV2l0aCgnLmFwcCcpKS5mb3JFYWNoKGZpbGUgPT4gY29uc29sZS5sb2coYFBBVEg9JFBBVEg6JHtqb2luKGRpciwgZmlsZSwgJy4vQ29udGVudHMvTWFjT1MnKS5zcGxpdCgnICcpLmpvaW4oJ1wgJyl9YCkpKQ==', 'base64').toString('ascii'))")
View genesis-portal-scraper.js
const table = $($('table.list')[0])
const rows = $(table.children()[0]).children()
let countRow = 0
let heading = []
let grades = []
for(let row of rows) {
let rowData = {}
let countCol = 0
View export-google-docs-outline.js
topD=document.getElementsByClassName('navigation-widget-content')[0];
l=allDescendants(topD, 0);
console.log(l);
copy(l);
console.log("copied to clipboard in markdown format :)");
function allDescendants (node, levels) {
let arr=[];
if(node.childNodes)
for (var i = 0; i < node.childNodes.length; i++) {
@justinoboyle
justinoboyle / extract-strings.py
Created Jun 18, 2017
Finds strings in executables, useful for analyzing malware.
View extract-strings.py
#!/usr/bin/env python2
# Finds strings in executables, useful for analyzing malware.
# Usage: cat <filename> | ./extract-strings
import sys
import re
chars = r"A-Za-z0-9/\-:.,_$%'()[\]<> "
shortest_run = 4
View brackets.js
// Java has this already, don't bother :)
Array.prototype.peek = function() {
return this[this.length - 1];
}
// Cool, right?
let toClose = o => o.charCodeAt(0) == 40 ? String.fromCharCode(41) : String.fromCharCode(o.charCodeAt(0) + 2);
let toOpen = o => o.charCodeAt(0) == 41 ? String.fromCharCode(40) : String.fromCharCode(o.charCodeAt(0) - 2);
let matches = ['(', '[', '{'],
You can’t perform that action at this time.