Skip to content

Instantly share code, notes, and snippets.

View DArcMattr's full-sized avatar
🍕

David Arceneaux DArcMattr

🍕
View GitHub Profile
@DArcMattr
DArcMattr / updb.sh
Last active October 8, 2015 23:48
WordPress development install sync script
#!/bin/sh
# Assumptions:
# 1) The machine environment variable is set, WEB_ENVIRONMENT, either 'test' or 'demo'
# 2) The development site URL is $WEB_ENVIRONMENT.$SITE
# 3) The following 3 lines are in wp-config.php
# if ( isset( $_GET[ 'relocate' ] ) && ( $_GET[ 'relocate' ] === $_ENV[ 'WEB_ENVIRONMENT' ] ) ):
# define( 'RELOCATE', TRUE );
# endif;
# 4) https://github.com/interconnectit/Search-Replace-DB is installed, with `replace_db` symlinked to `searchreplacedb2cli.php`
SITE="AAAA"
@DArcMattr
DArcMattr / attack.html
Created June 18, 2013 10:03
Attack of the CSS3 Transforms!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>grid</title>
<style type="text/css">
html {
background-color: #000;
width: 100%;
height: 100%;
@DArcMattr
DArcMattr / post-merge
Created September 3, 2013 19:45
Assumptions: You are using the SCSS flavor of SASS; even if you don't have SASS installed on the system you're using this on, you have it and compass installed on a machine you have SSH access to. Installation: 1) you *must* create a symbolic link to this in your .git/hooks directory "ln -s /path/to/git/hook/in/source/control /path/to/.git/hooks…
#!/bin/sh
# Create a symbolic link to this in the .git/hooks directory
theme_path="/absolute/path/to/theme/directory/here"
if [ $(git diff HEAD@{1} HEAD --name-only | grep -E 'style.scss' -c) -ne 0 ]; then
echo "style.scss changed, compiling"
if type "sass" > /dev/null 2>&1; then
sass --scss --compass -lC $theme_path/style.scss > $theme_path/style.css;
else
@DArcMattr
DArcMattr / gist:9140760
Created February 21, 2014 18:53
Vulnerability scans
arc-tv.com 178.208.248.9 - - [21/Feb/2014:10:45:43 -0800] "GET /wp-content/plugins/another-wordpress-classifieds-plugin/AWPCP.po HTTP/1.1" 404 6641 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.803.0 Safari/535.1"
arc-tv.com 178.208.248.9 - - [21/Feb/2014:10:45:44 -0800] "GET /wp-content/plugins/simple-dropbox-upload-form/index.php HTTP/1.1" 301 20 "-" "Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41 Safari/535.1"
arc-tv.com 178.208.248.9 - - [21/Feb/2014:10:45:44 -0800] "GET /wp-content/plugins/mac-dock-gallery/bugslist.txt HTTP/1.1" 404 6638 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.22 (KHTML, like Gecko) Chrome/19.0.1047.0 Safari/535.22"
arc-tv.com 178.208.248.9 - - [21/Feb/2014:10:45:44 -0800] "GET /wp-content/plugins/simple-dropbox-upload-form/ HTTP/1.1" 404 6635 "-" "Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41 Safari/535.1"
arc-tv
#showtooltip
/cancelform [nostance:0,mod:alt]
/console autounshift 0
/use Healing Touch
/console autounshift 1
#!/usr/bin/php
<?php // vim:ft=php
$max = intval( $argv[1] );
for ( $i = 1; $i <= $max; $i++ ) {
$string = '';
$string .= ( 0 === ( $i % 3 ) ) ? 'Fizz' : '';
$string .= ( 0 === ( $i % 5 ) ) ? 'Buzz' : '';
#!/usr/bin/php
<?php // vim:ft=php
if ( ! isset( $argv[1] ) ) {
die( 'No number input given' );
}
$max = intval( $argv[1] );
for ( $i = 1; $i <= $max; $i++ ) {
$string = '';
<?php
/*
Plugin Name: Minimal Rest API
Description: Very minimal DIY REST API plugin scaffold, must refresh permalink
settings to get this to work
*/
/**
* WP Init Action hook function
*
@DArcMattr
DArcMattr / .inputrc
Last active September 10, 2016 20:02
Config for Readline feature
# Two escapes clears command line
"\e\e": "\C-a\C-k"
"\t": menu-complete
set keymap vi
set editing-mode vi
$if mode=vi
set keymap vi-command
set keymap vi-insert
muplugins_loaded
pre_site_option_siteurl
default_site_option_siteurl
pre_option_siteurl
option_siteurl
site_option_siteurl
pre_option_home
option_home
register_taxonomy_args
gettext_with_context