Skip to content

Instantly share code, notes, and snippets.

@schurpf
schurpf / SketchSystems.spec
Last active March 19, 2019 20:34
# need entire service flow state machine
# need entire service flow state machine
Service state machine Level 1 - New Fitting
###############
# from any state
service_stop -> Ended without success
Service New*
update_data -> Data
update_survey -> Anamnese
@schurpf
schurpf / .gitignore
Last active August 29, 2015 14:18 — forked from salcode/.gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@schurpf
schurpf / watchr.rb
Created November 24, 2014 22:08
rb: watchr file for phpunit
watch('.*\.php') { |m| code_changed(m[0]) }
def code_changed(file)
run "phpunit"
end
def run(cmd)
result = `#{cmd}`
growl result rescue nil
end
@schurpf
schurpf / example-functions.php
Last active August 29, 2015 14:09
php: cmb2 text only metabox to display data, add 'type' => 'text_only' to use hook.
add_action( 'cmb2_render_text_only', 'sch_cmb_render_text_only', 10, 5 );
function sch_cmb_render_text_only( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
echo $escaped_value; //unescaped value: echo $field_object->value;
}
@schurpf
schurpf / Gruntfile.js
Created October 30, 2014 20:28
grunt: Gruntfile.js wordpressdeploy exclusions
'todo.txt','searchreplacedb2.php','Gruntfile.js', '.git/','.sass-cache/', 'tmp/*', 'backups/', '*.zip', 'wp-config.php', 'composer.json', 'composer.lock', 'README.md', 'searchreplacedb2.php', '.gitignore', '.idea/', 'package.json', 'node_modules', 'robots.txt', 'wp-content/uploads/snapshots/','.htaccess', 'tweet-old-post/', 'wp-to-buffer/'
@schurpf
schurpf / wp_install.sh
Created October 24, 2014 17:51
sh: create new wp install with wp-cli
#!/bin/bash
mysql -u root -proot -e "CREATE DATABASE wp_test_setup;"
mysql -u root -proot -e "CREATE USER 'mywpuser'@'localhost' IDENTIFIED BY 'H3S7g7vkzQwGvk';"
mysql -u root -proot -e "GRANT ALL PRIVILEGES ON wp_test_setup.* TO 'mywpuser'@'localhost';"
mysql -u root -proot -e "FLUSH PRIVILEGES;"
wp core download
wp core config --dbname=wp_test_setup --dbuser=mywpuser --dbpass=H3S7g7vkzQwGvk --dbhost=localhost
wp core install --url=localhost:8888/wp-test --title="Just another test site" --admin_name=admin --admin_email=michael@schurpf.com --admin_password=12345
@schurpf
schurpf / log
Last active August 29, 2015 14:08
php: custom file log
/**
* custom log in current directory
* @author schurpf
* @url http://schurpf.com
* @version 0.0
* @date 2014-10-28
* @dependency WP, needs plugin_dir_path
* @param string $log log message
* @param string $file filename
* @return bool return true on success
@schurpf
schurpf / gist:50fc8d1f9457dd37a366
Last active August 29, 2015 14:07 — forked from yratof/gist:4f312ae162f49876959c
php: wrap acf fields with barley editor
/**
* echo barley field with wrapper, use instead of the_field
* @author schurpf
* @url http://schurpf.com
* @version 0.1
* @date 2014-10-09
* @dependency barley, the_field_without_wpautop
* @param string $field_name your normal ACF field name
* @param boolean $noautop whether to omit wrapping p tags, needs the_field_without_wpautop
* @return none echos out content
@schurpf
schurpf / gist:e2188f8e0c31c9f2010c
Created October 9, 2014 21:06
php: echo ACF without wrapping p tags
/**
* ACF without paragraphs
* @author schurpf
* @url http://schurpf.com
* @version 0.0
* @date 2014-10-09
* @dependency [none]
* @param string $field_name your normal ACF field name
* @return none echos field without wrapping p tags
* @source http://support.advancedcustomfields.com/forums/topic/removing-paragraph-tags-from-wysiwyg-fields/