Skip to content

Instantly share code, notes, and snippets.

View say2joe's full-sized avatar
🏠
Codifying my code; possibly refactoring!

Joseph J. Johnson say2joe

🏠
Codifying my code; possibly refactoring!
View GitHub Profile
@say2joe
say2joe / PPA-Setup.sh
Last active October 27, 2019 17:36
Linux PPAs
sudo -s # || sudo -i
apt install apt-transport-https
add-apt-repository -y ppa:danielrichter2007/grub-customizer
add-apt-repository -y ppa:nilarimogard/webupd8 # WoeUSB
add-apt-repository -y ppa:yannubuntu/boot-repair
# Set up-to-date mirror for apt
# Check distros for errors
software-properties-gtk
@say2joe
say2joe / opkg-remove-and-clean.sh
Created March 15, 2019 14:47
OPkg: clean up from bad pkg install
#!/bin/sh
#takes one argument/parameter: the name of the package which didn't install correctly and should be removed along with its dependencies
#example: ./opkgremovepartlyinstalledpackage.sh pulseaudio-daemon
#get list of all packages that would be installed along with package x
PACKAGES=`opkg --force-space --noaction install $1 | grep "http:" | cut -f 2 -d ' ' | sed 's/\.$//'`
opkg update
for i in $PACKAGES
do
{"lastUpload":"2020-04-11T12:55:45.965Z","extensionVersion":"v3.4.3"}
/**
* JavaScript code for Steelhouse coding exercise.
* Any CSS is provided in the upper CSS directory.
*/
'use strict';
/**
Write a function that takes a single argument, lines, which is a list of
strings. Each element of lines is a line of prose from some passage. You will
return a list of strings that is read "downward", as opposed to left-to-right.
@say2joe
say2joe / JS-Quiz-Solutions.js
Last active February 25, 2021 05:59
My solutions to former employer's JS quiz for new employees
// Please save all your work in https://jsfiddle.net/
// Return the link to your work
// Answer five out of the seven questions
// Use test data when provided, however your functions should work with any similiarly structured data
// Use any additional libraries you like
// 1: Refactor this function to make it scalable.
var goto = function(evt, where, project, scenario, item, id){
if (evt && evt.stopPropagation){ evt.stopPropagation(); }
@say2joe
say2joe / viewReporting.js
Last active October 27, 2016 18:35
Angular View (vm integrated with legacy app code /wo ng routing)
(function($){
'use strict';
var $appRoot, auth, APIs, app = {},
tmpl = com.marketshare.optimizer.template,
reportCategoryKeys = 'nav-report-categories',
ns = 'com.marketshare.optimizer.view.viewReporting';
function updateNavigation(event) {
var $itemsHolder,
@say2joe
say2joe / PrototypeChain.js
Created January 26, 2015 19:06
JS Object Prototype Augmentation (JS helper methods)
if (![].unique) {
Array.prototype.unique = function() {
var n = {}, r = [], i = 0, l = this.length;
for (; i < l; i++) {
if (this[i] && !n[this[i]]) {
n[this[i]] = true;
r.push(this[i]);
}
}
return r;
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@say2joe
say2joe / bookmarklets.js
Last active April 7, 2022 16:38
Bookmarklet Helpers & JavaScript One-Liners
/** Assorted 1-liners that are very useful to eliminate repetition **/
const siblings = (ele) => [].slice.call(ele.parentNode.children).filter((child) => child !== ele);
/**
CanIUse.com Helper - prompt for a keyword then display the correct caniuse.com page.
Save this as a bookmark in the Bookmark Bar for quick access to CanIUse.com pages.
NOTE: Use the minified version below for the URL of the bookmark.
**/
/** Minified: