Skip to content

Instantly share code, notes, and snippets.

View octalmage's full-sized avatar

Jason Stallings octalmage

View GitHub Profile
@Hunter-Dolan
Hunter-Dolan / gist:4579913
Created January 20, 2013 17:10
"Post Commit" hook to append the lolcommits image to every commit.
#!/usr/bin/env ruby
commit = `git log -1 --oneline`
hash = commit.to_s.split(" ").first
message = commit.sub("#{hash} ", "")
unless(message.gsub("\n","").end_with?(".jpg"))
`lolcommits --capture`
repopath = `git rev-parse --show-toplevel`.gsub("\n", "")
repourl = `git config --get remote.origin.url`.gsub("\n", "")
@motionharvest
motionharvest / js
Created May 20, 2016 02:25
Robotjs Script for moving the mouse around in a circle depending on a given degree
var Mathutils = {
//not so important
normalize: function ($value, $min, $max) {
return ($value - $min) / ($max - $min);
},
interpolate: function ($normValue, $min, $max) {
return $min + ($max - $min) * $normValue;
},
/*
@octalmage
octalmage / spamhipchat.applescript
Last active January 18, 2017 16:25
Spam Hipchat.
delay 10
repeat 100 times
activate application "HipChat"
tell application "System Events" to keystroke "(parrot) (aussieparrot)"
tell application "System Events" to key code 76
delay 30
end repeat

Disable Plugins

Quickly disable all plugins in WordPress.

Usage

This plugin needs to go into the wp-content/mu-plugins/ directory. Provided you have SSH access to the server where WordPress lives, you can do this:

cd $SITE_ROOT/wp-content/mu-plugins
@larrymyers
larrymyers / gist:1219952
Created September 15, 2011 17:51
Create a version.txt file for builds via Jenkins / Hudson and Git
echo "JOB: $JOB_NAME" > version.txt
echo "BUILD NUMBER: $BUILD_NUMBER" >> version.txt
echo "GIT REVISION:" >> version.txt
git log -n 1 >> version.txt
@nacin
nacin / auto-update.php
Last active March 11, 2019 17:17
This is how @dd32 and I test automatic background updates in WordPress 3.7. Then just do example.com/?wp_maybe_auto_update. (If you use a checkout of develop.svn.wordpress.org, you can run this on the `build` directory, then simply run `grunt copy` between updates to copy over the latest code from `src`. This is how we are able to make adjustmen…
<?php
// Add this as a mu-plugin.
if ( isset( $_GET['wp_maybe_auto_update'] ) ) {
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' );
add_action( 'template_redirect', function() {
$time = date( 'r' );
echo "Starting... $time<br />";
delete_site_option( 'auto_core_update_failed' );
@lispc
lispc / multi_sig.sh
Last active January 16, 2020 08:08
IOST multiple signature
set -eu
TEST_USER_ID="testname"
GROUP="group"
IWALLET_CMD='iwallet --chain_id 1020 -s 127.0.0.1:30002' # single node dev chain
seckey1=3MWryACc5nSxRDJCJLe9Xq2spR1j7d5wYbZ4pZN4SvfgUxhG497DQxo5ahENoCnDkLsc7haSveP1q1zkt26JWhog
pubkey1=2ott3o9CZcaoZCe4nGYo1azEfEpY4W771GBFe133WW1p
function clean_account() {
$IWALLET_CMD account del $TEST_USER_ID
@joshuajnoble
joshuajnoble / binding.gyp
Last active September 23, 2020 04:01
Install "node-gyp", compile with "node-gyp configure build", voila.
{
"targets": [
{
"target_name": "keypress",
"conditions": [
['OS == "mac"', {
'include_dirs': [
'System/Library/Frameworks/CoreFoundation.Framework/Headers',
'System/Library/Frameworks/Carbon.Framework/Headers',
],
@robert-wallis
robert-wallis / capture.cpp
Created March 1, 2013 08:43
Capture the raw screen pixels in OSX. Then saves to a file for debugging.
void captureScreen()
{
CGImageRef image_ref = CGDisplayCreateImage(CGMainDisplayID());
CGDataProviderRef provider = CGImageGetDataProvider(image_ref);
CFDataRef dataref = CGDataProviderCopyData(provider);
size_t width, height;
width = CGImageGetWidth(image_ref);
height = CGImageGetHeight(image_ref);
size_t bpp = CGImageGetBitsPerPixel(image_ref) / 8;
uint8 *pixels = malloc(width * height * bpp);
@lukehefson
lukehefson / uninstall-GHfM.sh
Created November 27, 2013 13:48
Completely uninstall GitHub for Mac
#!/bin/bash
function remove_dir () {
rm -rf "$1_"
if [ -d "$1" ]
then
mv "$1" "$1_"
fi
}