Skip to content

Instantly share code, notes, and snippets.

View ms-studio's full-sized avatar

Manuel Schmalstieg ms-studio

View GitHub Profile
@ms-studio
ms-studio / add-term-to-post-tag.php
Last active September 3, 2021 12:57
add term metabox to post_tag taxonomy - using WP 4.4 term meta functions
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
// REGISTER TERM META
add_action( 'init', '___register_term_meta_text' );
function ___register_term_meta_text() {
@ms-studio
ms-studio / add-metabox-to-taxonomy.php
Created December 14, 2015 21:57
simple but complete example of adding metabox to taxonomy - using WP 4.4 term meta functions
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
// REGISTER TERM META
add_action( 'init', '___register_term_meta_text' );
function ___register_term_meta_text() {
@ms-studio
ms-studio / automatic-newsletter-from-formidable-input.md
Last active December 10, 2015 09:19
Tutorial: automatic newsletter based on a Formidable form

Automatic newsletter based on a Formidable form

This tutorial explains how to set up a newsletter that sends daily updates, based on input from a Formidable form (using the WordPress plugin Formidable).

In this specific example, the input is a "calendar" form, where users can add events to a calendar. The newsletter is posted every afternoon to announce events of the next day (it gets only sent when there is content for the next day).

What we need:

  1. Formidable form with date input: build a form that contains a date field (datepicker).
  2. Custom WordPress shortcode
@ms-studio
ms-studio / Max-and-Ableton-for-multiple-users.sh
Created December 3, 2015 15:37
A little bash script that makes the licence files of Max 7 and Ableton Live available for all users of a Mac OSX system
#!/bin/bash
mkdir -p "/Library/Application Support/Cycling '74/Max Authorization"
cd ~/Library/Application\ Support/Cycling\ \'74
cp -a "Max Authorization/Max 7" "/Library/Application Support/Cycling '74/Max Authorization/Max 7"
chmod -R ug+rwX,o+rX "/Library/Application Support/Cycling '74/"
chown -R root:staff "/Library/Application Support/Cycling '74/"
@ms-studio
ms-studio / snowden-ietf93.md
Created October 12, 2015 20:27 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
@ms-studio
ms-studio / test-for-template.php
Created May 27, 2015 20:42
Test if a WordPress Page Template is actually in use.
<?php
// some debugging info for admins:
if ( current_user_can( 'manage_options' ) ) {
/* A user with admin privileges */
// query for pages using a template:
$search_cfield = new WP_Query( array(
@ms-studio
ms-studio / custom-post-type.php
Created March 4, 2015 07:39
Créer un custom post type
function luma_register_post_types() {
register_post_type(
'blog', array(
'label' => __( 'Blog' ),
//'description' => 'Les films produits par Bord Cadre',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_icon' => 'dashicons-format-chat', // src: http://melchoyce.github.io/dashicons/
@ms-studio
ms-studio / casper-download-loop.js
Created March 2, 2015 09:40
CasperJS script for downloading sequential PDFs from a login-protected website
var casper = require('casper').create({
pageSettings: {
webSecurityEnabled: false
}
});
casper.start();
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');
@ms-studio
ms-studio / Gruntfile-for-WP.js
Last active August 29, 2015 14:02
Grunt.js workflow for WordPress
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: [
'js/build/*.js',
'css/build/*.css'
],
@ms-studio
ms-studio / sanitize-filename.php
Last active August 29, 2015 13:57 — forked from herewithme/sanitize-filename.php
Adding more problematic characters.
<?php
/*
Plugin Name: No french punctuation and accents for filename
Description: Remove all french punctuation and accents from the filename of upload for client limitation (Safari Mac/IOS)
Plugin URI: http://www.beapi.fr
Version: 1.0
Author: BeAPI
Author URI: http://www.beapi.fr
/*