Skip to content

Instantly share code, notes, and snippets.

@ammist
ammist / Notes
Created June 30, 2014 18:58
Image Getting w/ Genesis
Genesis_image will return full HTML (it may not be what you are looking for).
@ammist
ammist / gist:0ec470e125b39d718b6b
Last active August 29, 2015 14:04
jQuery Carousel Basics
<html>
<head>
<script type='text/javascript' src='jquery-1.11.1.min.js'></script>
<script type='text/javascript'>
$( document ).ready(function() {
console.log( "ready!" );
});
</script>
@ammist
ammist / blog_table_move.sql
Last active August 29, 2015 14:05
Moving Posts from one site to Another.
rename table wp_79_posts to wp_tmp_posts, wp_79_postmeta to wp_tmp_postmeta, wp_79_terms to wp_tmp_terms, wp_79_term_taxonomy to wp_tmp_term_taxonomy, wp_79_term_relationships to wp_tmp_term_relationships, wp_79_p2p to wp_tmp_p2p, wp_79_p2pmeta to wp_tmp_p2pmeta;
create table wp_79_posts like wp_posts;
INSERT wp_79_posts SELECT * FROM wp_posts;
create table wp_79_postmeta like wp_postmeta;
INSERT wp_79_postmeta SELECT * FROM wp_postmeta;
--
create table wp_79_terms like wp_terms;
INSERT wp_79_terms SELECT * FROM wp_terms;
create table wp_79_term_taxonomy like wp_term_taxonomy;
@ammist
ammist / .gitignore
Last active August 29, 2015 14:06
Default Tech Liminal .gitignore file
*/.ssh
.ssh/*
.mysql_history
.vim*
.bash*
.htaccess
*~
.DS_Store
.svn
.cvs
@ammist
ammist / multiplex-read.c
Created March 31, 2015 04:20
Basic Arduino Multiplexer code
/*
* Reading switches and tell to Serial.
*
*/
int numPins = 2;
int out[] = {4,5};
int in[] = {2,3};
@ammist
ammist / tl-cf7-captcha.html
Created May 16, 2011 00:20
Contact Form 7 with Captcha
<p>Your Name (required)<br />
[text* your-name] </p>
<p>Your Email (required)<br />
[email* your-email] </p>
<p>Subject<br />
[text your-subject] </p>
<p>Your Message<br />
[textarea your-message] </p>
<p class="captcha">
Enter the following phrase in the text box below:
@ammist
ammist / wp-custom-post-type.php
Created June 15, 2011 17:03
[WP] Create a Custom Post Type
register_post_type('book', array('label' => 'Books',
'description' => 'Books and other items for sale on the Heyday website',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => array('slug' => ''),
'query_var' => true,
'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','author','page-attributes',),
@ammist
ammist / svn_overwrite.sh
Created June 29, 2011 08:23 — forked from doolin/svn_overwrite.sh
[WP] [SVN] - Getting WordPress out of SVN
#!/usr/bin/sh
# This script will overwrite an existing
# WordPress installation with the current
# head of trunk. Once it has been reverted,
# you may need to update the database, and
# WP will prompt you for that automatically.
# This is untested with these options!
# The script commands work from the command
@ammist
ammist / change_urls.sql
Created August 31, 2011 07:28
MySQL Wrangling
-- handy for moving a database from prouction to your local environment.
-- change URL's in wordpress single-site install. Replace with your own URL's.
-- this doesn't address serialized options.
UPDATE wp_options SET option_value = "http://localhost:8888" WHERE option_name = "home";
UPDATE wp_options SET option_value = "http://localhost:8888" WHERE option_name = "siteurl";
update wp_postmeta set meta_value = replace(meta_value, 'http://example.com', 'http://localhost:8888') where meta_key='_menu_item_url';
update wp_posts set post_content = replace(post_content, 'http://example.com', 'http://localhost:8888');
@ammist
ammist / gist:1252863
Created September 30, 2011 06:22
[WP] Install WP quickly
# This script is for shell users who have previously created a database.
mkdir ~/installs
cd ~/installs
wget http://wordpress.org/latest.zip
unzip latest.zip
cp wordpress/* ~/public_html/
cd ~/public_html/
cp wp-config-sample.php wp-config.php
vi wp-config.php