Skip to content

Instantly share code, notes, and snippets.

View bostondv's full-sized avatar
🎩

Boston Dell-Vandenberg bostondv

🎩
View GitHub Profile
@bostondv
bostondv / wordpress.sql
Last active January 12, 2018 05:04
WordPress: database scripts
/* Delete duplicate posts */
DELETE bad_rows.*
from wp_posts as bad_rows
inner join (
select post_title, MIN(id) as min_id
from wp_posts
group by post_title
having count(*) > 1
) as good_rows on good_rows.post_title = bad_rows.post_title
and good_rows.min_id <> bad_rows.id
@bostondv
bostondv / snippets.sh
Last active September 26, 2015 08:37
UNIX: general snippets
# Chmod all files and directories
find . -type d -print0 | xargs -0 chmod 0755
find . -type f -print0 | xargs -0 chmod 0644
# run command as another user
sudo -u USER -H COMMAND
# find and remove files
find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;
@bostondv
bostondv / style.css
Created March 9, 2012 22:01 — forked from luetkemj/style.css
WordPress: Wordpress classes
/* =============================================================================
WordPress WYSIWYG Editor Styles
========================================================================== */
.entry-content img {
margin: 0 0 1.5em 0;
max-width: 100%;
height: auto;
}
.alignleft, img.alignleft {
@bostondv
bostondv / wp-config.php
Created March 17, 2012 21:58
WordPress: Sample Config
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@bostondv
bostondv / .htaccess
Last active October 1, 2015 21:48
Useful .htaccess snippets
# Turn on rewrite
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
# RewriteBase /
</IfModule>
# rewrite olddomain.com → newdomain.com
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
@bostondv
bostondv / scripts.js
Created March 23, 2012 13:00
jQuery: Open external links in new window
// External links new window
$("a[href*='http://']:not([href*='"+location.hostname.replace
("www.","")+"'])").attr('target','_blank');
// rel=external new window
$("a[rel='external']").attr('target','_blank');
@bostondv
bostondv / css-tidy.tpl
Created April 19, 2013 15:09
CSS Tidy uncompressed template.
<span class="at">|</span> <span class="format">{</span>
|<span class="selector">|</span> <span class="format">{</span>
| <span class="property">|</span> <span class="value">|</span><span class="format">;</span>
|<span class="format">}</span>|
|
<span class="format">}</span>
||<span class="comment">|</span>
|
@bostondv
bostondv / gist:5475620
Last active April 3, 2017 15:21
WordPress: disable new user registration email
/**
* Disable new user registration emails sent to the site admin
*/
function disable_registration_email_filter($result = '') {
extract($result);
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
if (strstr(sprintf(__('[%s] New User Registration'), $blogname), $subject)) {
$to = '';
$subject = '';
$message = '';
@bostondv
bostondv / virtual
Created September 7, 2013 13:48
VirtualDocumentRoot Apache Config
UseCanonicalName Off
DocumentRoot /path/to/www
VirtualDocumentRoot /path/to/www/%1
ServerName %1.local
CacheDisable /path/to/www/%1
<Directory /path/to/www/%1>
Options Indexes FollowSymLinks Multiviews +Includes
AllowOverride All
</Directory>

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post