Skip to content

Instantly share code, notes, and snippets.

View zachattack's full-sized avatar
🎯
Focusing

Zach zachattack

🎯
Focusing
View GitHub Profile
@zachattack
zachattack / Sort Numbers Descending
Created July 9, 2019 15:24
JS Descending Sort Numbers
function descendingOrder(n){
// Store your string manipulation in a results variable.
let results;
// Make sure the number isn't negative.
if(n>=0) {
return Number(results = String(n).split('').sort().reverse().join(""));
}
return false;
}

Keybase proof

I hereby claim:

  • I am zachattack on github.
  • I am hanzouzach (https://keybase.io/hanzouzach) on keybase.
  • I have a public key ASBrJ82vqjj04B61UfelKgBVsyaNndg2imm9_9AnskHZQAo

To claim this, I am signing this object:

Export Migration and Mapping

If you have custom content types that you want to migrate from a Drupal 7 installation to a WordPress installation, you will need to have a few things in place to make it happen.

  1. Modify the default XML output templates to look and smell like a WordPress export.

  2. Mapping Categories If you have unique categories and you want them to match up with taxonomy that you have created on your new site, you will need intercept the categories that are presently applied and overwrite them.

  3. Create the needed Drupal views

<title><YOUR TITLE HERE> | University of TEXAS at Austin</title>
<meta property="og:title" content="<YOUR TITLE HERE>" />
<meta name="author" content="<SITE or POST AUTHOR>" />
<meta property="og:locale" content="en" />
<meta name="description" content="<POST SUMMARY or DEFAULT SITE DESCRIPTION>" />
<meta property="og:description" content="<POST SUMMARY or DEFAULT SITE DESCRIPTION>" />
<link rel="canonical" href="<SITE URL>" />
<meta property="og:url" content="<SITE URL>" />
<meta property="og:site_name" content="<SITE NAME>" />
<meta property="og:image" content="<SITE URL>/path/to/iamges.jpg" />
@zachattack
zachattack / wp-gulp.js
Created November 13, 2018 16:18
Simple Gulp Config for Word Press Dev
// Gulp.js configuration
'use strict';
const
// source and build folders
dir = {
src : './static/',
lib : './static/lib/',
build : './assets/'
@zachattack
zachattack / pseudo-placeholder-who.css
Created October 14, 2016 19:48
The Pseudo Placeholder Text
/*
FROM CSS Tricks 2013
https://css-tricks.com/snippets/css/style-placeholder-text/
*/
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder { /* Firefox 18- */
@zachattack
zachattack / audio-converter.sh
Last active May 3, 2016 16:55
Easy FFMPEG Audio Converter Script
for a in *.audio ; do
f="${a[@]/%audio/mp3}"
ffmpeg -i "$a" -acodec libmp3lame -q:a 0 "$f"
done
@zachattack
zachattack / Drupal 7 facebook meta
Created February 19, 2014 18:51
Pesky Facebook sharing scraper fixes. This will allow you total control of the meta info for the Facebook scraper and will allow you to customize the image and title text that is displayed for any node.
// This goes into your template.php file
function YOURTHEME_preprocess_html(&$variables, $hook) {
// Add a title variable to the html template that uses the current node's title.
if ($node = menu_get_object()) {
$variables['html_title'] = $node->title;
}
// Use the theme's logo as the og:image.
$variables['html_logo'] = theme_get_setting('logo');
}
@zachattack
zachattack / block-title-unset
Created July 18, 2013 21:15
Unset a block title in Drupal 7 with preprocess.
function YOURTHEME_preprocess_block(&$variables, $hook) {
// Unset the block titles in the region of choice.
if ($variables['block']->region == 'region-you-target') {
unset($variables['block']->subject);
}
}
@zachattack
zachattack / gist:3728371
Created September 15, 2012 15:00
Drupal form tweaking
// Custom search form tweaking funciton.
function YOURTHEME_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'search_block_form') {
$form['search_form']['#title'] = t('Search'); // Change the text on the label element
$form['search_form']['#title_display'] = 'invisible'; // Toggle label visibilty
$form['search_form']['#size'] = 40; // define size of the textfield
$form['search_form']['#default_value'] = t('Search'); // Set a default value for the textfield
//$form['actions']['submit']['#value'] = t('GO!'); // Change the text on the submit button
//$form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/images/search-button.png');