Skip to content

Instantly share code, notes, and snippets.

View tommymarshall's full-sized avatar

Tommy Marshall tommymarshall

View GitHub Profile
@tommymarshall
tommymarshall / resources.txt
Created May 11, 2015 22:40
Wordpress Search resources
https://codex.wordpress.org/Function_Reference/get_categories#Dropdown_Box_as_used_in_Parent_category_at_post_category_page
https://wordpress.org/support/topic/how-to-display-the-child-category-of-a-specific-parent-category
https://wordpress.org/support/topic/get-parent-category
https://wordpress.org/support/topic/ordering-by-meta-key-value
http://stackoverflow.com/questions/15613750/do-a-custom-query-search-in-wordpress-by-post-meta
http://wordpress.stackexchange.com/questions/105696/custom-search-for-custom-post-type-custom-meta-and-search-fields
@tommymarshall
tommymarshall / .zshrc
Created May 11, 2015 14:16
My Aliases
# Just writing `p` is so much faster
alias p="gulp"
# And for Grunt
alias u="grunt"
# Server the current directory at localhost:8884
alias simpleserver="python -m SimpleHTTPServer 8884"
# Copy my public key to clipboard
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
# Easy editing my zshrc file
alias zshrc="subl ~/.zshrc"
@tommymarshall
tommymarshall / test_mail.php
Created March 23, 2015 22:28
Test mail har har
<?php
if (mail('[email protected]', 'Subject', 'Body goes here')) {
echo 'awesome';
} else {
echo 'failed';
}
@tommymarshall
tommymarshall / example.scss
Created March 11, 2015 20:07
CSStyle, without component.
// CSStyle
@include component(button) {
background: red;
@include option(blue) {
color: blue;
}
}
// Without component
@tommymarshall
tommymarshall / SassMeister-input.scss
Created March 11, 2015 20:01
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
// csstyle v1.3.1 for sass
// Clean, Simple Styling for the Web
// http://www.csstyle.io
// Copyright (c) 2014 Dave Geddes
// https://twitter.com/geddski
@tommymarshall
tommymarshall / examples.scss
Created March 11, 2015 16:52
CSStyle example
// CSStyle
@include component(button) {
display: block;
@include option(blue) {
color: blue;
}
@include part(icon) {
position: absolute;
@tommymarshall
tommymarshall / composer.json
Created February 25, 2015 14:48
ACF composer
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "5.1.9.1",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "http://connect.advancedcustomfields.com/index.php?p=pro&a=download&k=YOUR_KEY_HERE="
}
function wp_api_encode_acf($data,$post,$context){
$data['meta'] = array_merge($data['meta'],get_fields($post['ID']));
return $data;
}
if( function_exists('get_fields') ){
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3);
}
@tommymarshall
tommymarshall / classNameHelper.rb
Created January 26, 2015 22:01
Thing to generate classes? What's ruby?
className([
'folder',
'list__item',
'folder--empty' => current_conversations.count == 0,
'search-facet__list__item--has-children',
'search-facet__list__item',
'search-facet__list__item--active' => current_conversations.include?(conversation)
])
@tommymarshall
tommymarshall / output.json
Created January 15, 2015 20:16
wp api json output
{
"ID":1,
"title":"Hello world!",
"status":"publish",
"type":"post",
"author":{
"ID":1,
"username":"admin",
"name":"admin",
"first_name":"",