Skip to content

Instantly share code, notes, and snippets.

View phillipadsmith's full-sized avatar

Phillip Smith phillipadsmith

View GitHub Profile
@phillipadsmith
phillipadsmith / gist:3124464
Created July 16, 2012 19:16
Invite all friends on FB to an event
javascript:var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');
@phillipadsmith
phillipadsmith / gist:2714986
Last active August 4, 2016 05:55
Meta tag example from The Tyee, following the boilerplate posted earlier.
<meta name="bricolage-log" content="1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="generator" content="Bricolage 2.1.0" />
<meta name="bricolage-id" content="57988" />
<meta name="bricolage-uuid" content="5C333394-9E45-11E1-9FD5-92BA81F25826" />
<meta name="bricolage-title" content="The Future of Education Is Here..." />
<meta name="bricolage-enable-comments" content="1" />
<meta name="bricolage-days-comments" content="5" />
<meta name="bricolage-publish-date" content="2012-05-16 00:10:00.000000" />
<!-- General properties -->
<?php $args = array(
'numberposts' => -1,
'offset' => 0,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'custom_post_type_here',
'post_status' => 'draft',
'meta_query' => array(
array(
'key' => 'custom_field_key_name',
<!-- General properties -->
<meta name="description" content="" />
<meta name="author" content="">
<meta name="keywords" content="">
<meta name="robots" content="index, follow" />
<meta name="revisit-after" content="7 days" />
<meta name="copyright" content="" />
<meta name="unix_date" content="" />
<meta name="date" content="" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
@phillipadsmith
phillipadsmith / gist:2640373
Created May 8, 2012 23:26
Diff file from the original Worpress CSV User Import to one that supports more user fields
diff --git a/Users/phillipadsmith/Downloads/csv-user-import/csv-user-import.php b/wp-content/plugins/csv-user-import/csv-user-import.php
index ea2e26f..2ef4fa5 100644
--- a/Users/phillipadsmith/Downloads/csv-user-import/csv-user-import.php
+++ b/wp-content/plugins/csv-user-import/csv-user-import.php
@@ -37,17 +37,27 @@ function csvuserimport_page1() {
if (is_array($arr_rows)) {
foreach ($arr_rows as $row) {
- // split into values
- $arr_values = split(",", $row);
@phillipadsmith
phillipadsmith / gist:2640242
Created May 8, 2012 23:04
Example of extended CSV for importing user data with Wordpress CSV User Import plug-in
"Test","User","testuser","Change me now!","testuser@donotreply.com","Test user's bio","http://testuser.com","testuseraim","testuserjabber","testuseryim","testuserfb","testusertw","testusergplus"
@phillipadsmith
phillipadsmith / gist:2002033
Created March 8, 2012 16:52
DBD::mysql installation error message
# Error: Can't load '/Users/phillipadsmith/.cpanm/work/1331223172.70221/DBD-mysql-4.020/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/phillipadsmith/.cpanm/work/1331223172.70221/DBD-mysql-4.020/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.18.dylib
# Referenced from: /Users/phillipadsmith/.cpanm/work/1331223172.70221/DBD-mysql-4.020/blib/arch/auto/DBD/mysql/mysql.bundle
# Reason: image not found at /Users/phillipadsmith/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/darwin-2level/DynaLoader.pm line 194.
# at (eval 7) line 2.
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
-> FAIL Installing DBD::mysql failed. See /Users/phillipadsmith/.cpanm/build.log for details.
@phillipadsmith
phillipadsmith / gist:1410885
Created November 30, 2011 21:19
Mobile site redirection using mod_rewrite (with option for smart phones vs. feature phones)
# If the visit is from a mobile user agent, and there's no fullsite cookie, redirect and stop
# if the browser accepts these mime-types, it's definitely mobile, or pretending to be
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR]
# a bunch of user agent tests for very basic phones
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "ericsson,|panasonic|philips|sanyo|sharp|sie-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\."[NC,OR]
# Slightly more advanced phones, but probably still worth sending them to the simple HTML site
@phillipadsmith
phillipadsmith / mod_rewrite_rules
Created November 22, 2011 21:12
Mobile site redirection using mod_rewrite
RewriteEngine On
# If the user is asking for the fullsite, set a cookie, remove the query, and stop.
RewriteCond %{QUERY_STRING} ^fullsite$
RewriteRule ^/?(.*)$ http://domain.com/$1? [L,CO=fullsite:yes:.domain.com]
# If the user is asking for the mobilesite, set a cookie, remove the query, redirect and stop.
RewriteCond %{QUERY_STRING} ^mobilesite$
RewriteRule ^/?(.*)$ http://m.domain.com/$1? [L,CO=fullsite:no:.domain.com]
@phillipadsmith
phillipadsmith / gist:1148397
Created August 16, 2011 03:37
Catalyst::Default - local environment file
{
"DOTCLOUD_DATA_SQL_PASSWORD": "catalyst",
"DOTCLOUD_DATA_SQL_HOST": "localhost",
"DOTCLOUD_DATA_SQL_LOGIN": "catalyst",
"DOTCLOUD_DATA_SQL_PORT": "5432"
}