Skip to content

Instantly share code, notes, and snippets.

@joemaller
joemaller / kill-dashlane.sh
Created October 2, 2015 12:41
I think this stops Dashlane from hijacking Chrome
launchctl list | grep dashlane
launchctl stop com.dashlane.DashlaneAgent
launchctl remove com.dashlane.DashlaneAgent
@joemaller
joemaller / Managed WordPress Hosting .gitignore
Last active August 11, 2023 21:40
A comprehensive .gitignore file for managed WordPress hosts.
# Managed WordPress Hosting .gitignore file for ignoring WordPress files
#
# Most recent revision here:
# https://gist.github.com/joemaller/4f7518e0d04a82a3ca16
#
# Raw Source (for curl):
# https://gist.githubusercontent.com/joemaller/4f7518e0d04a82a3ca16/raw
#
# Used by these WordPress Development environments:
# https://github.com/ideasonpurpose/docker-wordpress-dev
@joemaller
joemaller / wpengine-boilerplate-gitignore-sorted
Created October 20, 2015 21:07
A sorted copy of the gitignore file from wpengine.com/git updated to a sorted copy of the gitignore file found in a default installation. (view the diff)
*.3gp
*.3gpp
*.asf
*.asx
*.avi
*.bak
*.bin
*.deb
*.dll
*.dmg
'use strict';
var through2 = require('through2');
var should = require('should');
require('mocha');
var failStream = function() {
return through2.obj(function(chunk, encoding, callback) {
this.push({})
this.emit('error', new Error('failStream has failed'));
callback()
@joemaller
joemaller / hamster-dance.sh
Created April 1, 2016 19:01
prank shell script, plays hamster dance YouTube loud. Sadly can't deal with headphones
#!/usr/bin/env bash
osascript -e "set Volume 10"
open "https://www.youtube.com/watch?v=6WpMlwVwydo"
osascript -e 'if application "Google Chrome" is running then' -e'tell app "System Events" to set visible of process "Google Chrome" to false' -e 'end'
osascript -e 'if application "Safari" is running then' -e'tell app "System Events" to set visible of process "Safari" to false' -e 'end'
@joemaller
joemaller / .block
Last active August 7, 2016 19:38 — forked from mbostock/.block
Build Your Own Graph!
license: gpl-3.0
@joemaller
joemaller / lsusb
Created September 12, 2016 13:15
Raspbian video debugging
pi@raspberrypi:~ $ lsusb
Bus 001 Device 012: ID 05ac:0220 Apple, Inc. Aluminum Keyboard (ANSI)
Bus 001 Device 011: ID 05ac:1006 Apple, Inc. Hub in Aluminum Keyboard
Bus 001 Device 007: ID 2109:2811
Bus 001 Device 014: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device
Bus 001 Device 006: ID 2109:2811
Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 004: ID 046d:c526 Logitech, Inc. Nano Receiver
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
@joemaller
joemaller / Git-branch aware Bash prompt .bashrc .sh
Last active March 17, 2018 16:57
A custom terminal (Bash) prompt which shows name and state of the current Git branch (if available). Brings together ideas from https://gist.github.com/joemaller/4503986 and https://gist.github.com/joemaller/4527475
# https://gist.github.com/joemaller/3165ace4b1f8a50924990ad373236ce8
#
# Append this file to the end of your ~/.bashrc file
# Your terminal prompt will look something like this:
#
# username@hostname /output/of/pwd [git-branch]$
# https://gist.github.com/4503986
#
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
The following groups are read: mysqld server mysqld-5.5
var githubPriceForUsers = function (users) {
return Math.max(0, users - 5) * 9 + 25;
};
var githubUsersForCost = function (price) {
var f = Math.ceil(Math.max(0, price - 25)/9);
return [`${f + 5} users`, `$${b(f + 5)}`];
}