Skip to content

Instantly share code, notes, and snippets.

@darrenjaworski
darrenjaworski / gist:11066120
Created April 18, 2014 21:54
wp new domain sql
UPDATE wp_options SET option_value = replace(option_value, 'OLD_VALUE', 'NEW_VALUE') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'OLD_VALUE','NEW_VALUE');
UPDATE wp_posts SET post_content = replace(post_content, 'OLD_VALUE', 'NEW_VALUE');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'OLD_VALUE','NEW_VALUE');
UPDATE wp_term_taxonomy SET description = replace(description, 'OLD_VALUE', 'NEW_VALUE');
@darrenjaworski
darrenjaworski / 1.html
Last active August 29, 2015 14:01
wp head favicon roots
<link rel="apple-touch-icon" sizes="57x57" href="<?php echo get_template_directory_uri(); ?>/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?php echo get_template_directory_uri(); ?>/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?php echo get_template_directory_uri(); ?>/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="60x60" href="<?php echo get_template_directory_uri(); ?>/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="120x120" href="<?php echo get_template_directory_uri(); ?>/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="76x76" href="<?php echo get_template_directory_uri(); ?>/assets/favicons/apple-touch-icon-76x76.png">
<link rel="icon" type="image/png" href="<?php echo get_template_directory_uri(); ?>/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="<?php echo get
UPDATE craft_info set siteUrl = replace(option_value, 'OLD_VALUE', 'NEW_VALUE')
@darrenjaworski
darrenjaworski / gist:4fea6505516e3ba2b7e8
Last active August 29, 2015 14:05
Craft, combine two sets of entry objects. Then limit the merged set to those not already included.
{% set stories = entry.featuredStories %}
{% set combined = [] %}
{% set idArray = [] %}
{% for story in stories %}
{% set combined = combined|merge([story]) %}
{% set idArray = idArray|merge([story.id]) %}
{% endfor %}
{% if entry.featuredStoryTags|length %}
craft_assettransformationindex
@darrenjaworski
darrenjaworski / index.html
Last active August 29, 2015 14:05
Highcharts test
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<iframe width="100%" height="500" src="http://cloud.highcharts.com/embed/oqatuk" style="border: 0px;"></iframe>
</div>
</body>
</html>
@darrenjaworski
darrenjaworski / index.html
Created September 8, 2014 03:35
Orthographic
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
( function map() {
@darrenjaworski
darrenjaworski / index.html
Last active August 29, 2015 14:06
Orthographic transition I
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
( function map() {
@darrenjaworski
darrenjaworski / index.html
Last active August 29, 2015 14:06
Orthographic transition II
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
( function map() {
@darrenjaworski
darrenjaworski / index.html
Last active August 29, 2015 14:06
Orthographic Transition III
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
( function map() {