Skip to content

Instantly share code, notes, and snippets.

@shadyvb
shadyvb / gist:6490501
Last active December 22, 2015 15:09
Facebook photo delete, quick console command
document.getElementsByClassName('fbPhotosPhotoActionsItem')[document.getElementsByClassName('fbPhotosPhotoActionsItem').length-1].click(); setTimeout(function(){ document.getElementsByClassName('layerConfirm')[0].click() }, 500);
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost
alias lso="ls -alG | awk '{k=0;for(i=0;i<=8;i++)k+=((substr(\$1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(\" %0o \",k);print}'"
@shadyvb
shadyvb / gist:6632925
Last active December 23, 2015 12:08
wp-cli quick install
curl https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh | bash
echo 'source $HOME/.wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash' | tee -a ~/.bash_profile
echo 'export PATH=$HOME/.wp-cli/bin:$PATH' | tee -a ~/.bash_profile
source ~/.bash_profile
@shadyvb
shadyvb / gist:6792634
Created October 2, 2013 12:01
Default to pull-request to develop branch instead of master on github
// ==UserScript==
// @name Compare pull-requests against develop branch instead of master branch
// @namespace http://sharaf.me/
// @version 0.1
// @match https://github.com/*/compare/issue*
// @copyright 2013+, Shady Sharaf
// @run-at document-start
// ==/UserScript==
window.location.href = window.location.href.replace('compare/issue', 'compare/develop...issue')
@shadyvb
shadyvb / missing-fields.patch
Created November 29, 2013 17:19
usa-epay patch to send item data
From 33ba1d8b22781027e9c02f42a01342c35a5a11da Mon Sep 17 00:00:00 2001
From: Shady Sharaf <[email protected]>
Date: Fri, 29 Nov 2013 07:01:05 +0200
Subject: [PATCH] Add missing fields
---
woocommerce-gateway-usaepay.php | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/woocommerce-gateway-usaepay.php b/woocommerce-gateway-usaepay.php
@shadyvb
shadyvb / us-github-unassigned-issues-filter.js
Last active August 29, 2015 13:56
[userscript] Unassigned filter in GitHub issues screen
// ==UserScript==
// @name Unassigned issues filter in GitHub
// @namespace
// @version 0.1
// @description Add unassigned issue link in issues filters
// @match https://github.com/*/*/issues*
// @copyright 2014+, Shady Sharaf <[email protected]>
// @see http://stackoverflow.com/questions/9711923/is-there-any-way-show-all-github-tickets-without-an-assignee
// ==/UserScript==
var fn = function(){
@shadyvb
shadyvb / us-github-notification-new-tab.js
Last active August 29, 2015 13:56
Open GitHub notification links in new tab
// ==UserScript==
// @name Open GitHub notification links in new tab
// @namespace
// @version 0.1
// @description Open GitHub Notifications in new tabs
// @match https://github.com/*/notifications*
// @copyright 2014+, Shady Sharaf <[email protected]>
// ==/UserScript==
jQuery(function($){
@shadyvb
shadyvb / p2-likes-to-fives.php
Created February 12, 2014 00:28
Change Like to Five! in P2 Likes plugin
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function p2_like2five( $translated_text, $text, $domain ) {
if ( 'p2-likes' != $domain ) {
return $translated_text;
}
switch ( $text ) {
# vagrant vsftp and other tricks
# from: https://ttboj.wordpress.com/2013/12/21/vagrant-vsftp-and-other-tricks/
# and
# Vagrant clustered SSH and 'screen'
# from: https://ttboj.wordpress.com/2014/01/02/vagrant-clustered-ssh-and-screen/
# for use inside a ~/.bashrc or similar
# copyright James Shubin, 2013, agplv.3+
### VAGRANT ###################################################################
# avoid needing to always add --provider=kvm