Skip to content

Instantly share code, notes, and snippets.

View JodiWarren's full-sized avatar
🎯
Focusing

Jodi Warren JodiWarren

🎯
Focusing
View GitHub Profile
@JodiWarren
JodiWarren / gravityforms.scss
Created January 20, 2014 12:00
Style Gravity Forms with Bootstrap 3 (SASS) - From: http://roots.io/style-gravity-forms-with-bootstrap/
.gform_wrapper ul {
@extend .list-unstyled;
}
.gform_wrapper li {
@extend .form-group;
}
.gform_wrapper form {
margin-bottom: 0;
}
.gform_wrapper .gfield_required {
Options All -Indexes
<files .htaccess>
Order allow,deny
Deny from all
</files>
<files readme.html>
Order allow,deny
Deny from all
</files>
<files license.txt>
@JodiWarren
JodiWarren / find and replace filenames
Last active August 29, 2015 14:02
Find/replace filename in fish shell
for i in *.svg
set -x j (echo $i|sed 's/regex-string-to-find/string-to-replace/')
mv "$i" "$j"
end
set fish_git_dirty_color red
set fish_git_not_dirty_color green
function parse_git_branch
set -l branch (git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1/')
set -l git_diff (git diff)
if test -n "$git_diff"
echo (set_color $fish_git_dirty_color)$branch(set_color normal)
else
@JodiWarren
JodiWarren / acf_gf_function.php
Created September 2, 2014 15:22
Advanced Custom Fields (ACF) get_field helper function
/**
* Simple boolean helper to check if ACF is on.
* @return boolean
*/
function is_acf(){
return function_exists( 'get_field' ) ? true : false;
}
/**
* Helper function for ACF get_field function
@JodiWarren
JodiWarren / pre_get_posts_on_date_archive.php
Last active August 29, 2015 14:06
Wordpress sort by meta key on date archive
<?php
add_action( 'pre_get_posts', 'sort_by_custom_field' );
function sort_by_custom_field( $query ){
// Make sure we're on the front end, that we're dealing with the main query and that we're on the post type archive for the product custom post type. Also that at least a year is set.
if ( is_admin() || ! $query->is_main_query() || ! $query->is_post_type_archive( 'product' ) || ! $query->is_date() ) {
return $query;
}
@JodiWarren
JodiWarren / gist:2e2ed9cdf7a91cb92fb4
Last active August 29, 2015 14:14
Sublime CSS Comb Config
{
// Full list of supported options and acceptable values can be found here:
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md
"config": {
// Whether to add a semicolon after the last value/mixin.
"always-semicolon": true,
// Set indent for code inside blocks, including media queries and nested rules.
"block-indent": " ",
@JodiWarren
JodiWarren / textytypes.md
Last active January 2, 2018 08:48
Text vs Non-text input types
<?php
// put array in here
$array = array (
'key' => 'group_54624ad06f391',
'title' => 'Company List',
'fields' => array (
array (
'key' => 'field_54624aff43237',
'label' => 'Companies',
@JodiWarren
JodiWarren / googleforms2slack.gs
Created October 7, 2015 09:42 — forked from andychase/googleforms2slack.gs
Google Forms Slack Notification
// Google Forms Slack Notification
// Jodi Warren <github.com/jodiwarren> based on a script by Andy Chase <github.com/andychase>
// License: CC0 1.0 Universal <creativecommons.org/publicdomain/zero/1.0>
// Install 1: This code goes in ( tools > script editor... ) of your google docs form
// Install 2: ( resources > current project triggers ) ( [onSubmit], [from Form], [On form submit] )
// Setup 1: Put your slack api url below
var POST_URL = "https://hooks.slack.com/services/1234567890"; // Change this or it won't work at all
// Customise your Slack message