Skip to content

Instantly share code, notes, and snippets.

View iCaspar's full-sized avatar

Caspar Green iCaspar

View GitHub Profile

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@iCaspar
iCaspar / theme-autoloader.php
Last active September 18, 2015 12:49
Class Autoloader for WordPress theme
<?php namespace Potsdam\Inc;
/**
* Potsdam Theme Autoloader
*
* @package Potsdam
* @since 1.0
*/
/** No Direct Access */
if ( ! defined( 'ABSPATH' ) )
die( 'Fizzle' );
<?php
/**
* widget-demo.php
*
* Our widget demo plugin
*
* @author: Caspar Green <https://caspar.green>
* @package: widget-demo
* @version: 1.0.0
*/
<?php
add_action( 'widgets_init', 'ic_remove_simple_social_css', 999 );
function ic_remove_simple_social_css() {
global $wp_registered_widgets;
$widgetNames = array_keys( $wp_registered_widgets );
$ssWidgets = [];
foreach ( $widgetNames as $name ) {
<?php
/**
* Default tabs for theme options.
* @since 1.6
*/
function ar2_theme_options_default_tabs() {
global $ar2_postviews;
@iCaspar
iCaspar / setup-phpunit.sh
Created September 28, 2018 14:39 — forked from keesiemeijer/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, git, subversion, composer, curl and wget
#
# The $WP_CORE_DIR and $WP_TESTS_DIR environment variables are added to the ~/.bashrc file
#

Keybase proof

I hereby claim:

  • I am icaspar on github.
  • I am icaspar (https://keybase.io/icaspar) on keybase.
  • I have a public key ASBftpCdb4twXjY8lVkXTDufuSCLPn-aRA2OOhG1idjaFAo

To claim this, I am signing this object:

@iCaspar
iCaspar / countpositivessumnegatives.php
Last active November 4, 2018 02:02
Cata: Count of Positives / Sum of Negatives
<?php
/**
* Unit tests for "Count of Positives / Sum of Negatives" puzzle
*
* Requirements: @see https://www.codewars.com/kata/count-of-positives-slash-sum-of-negatives/php
* Given an array of integers.
* Return an array, where the first element is the count of positives numbers
* and the second element is sum of negative numbers.
*
* If the input array is empty or null, return an empty array.
@iCaspar
iCaspar / MatrixAddition.php
Last active November 4, 2018 20:34
Matrix Addition puzzle
<?php
/**
* Unit tests for Matrix Addition puzzle.
*
* Requirements: @see https://www.codewars.com/kata/matrix-addition
* Write a function that accepts two square matrices (N x N two dimensional arrays),
* and return the sum of the two.
* Both matrices being passed into the function will be of size N x N (square),
* containing only integers.
*
@iCaspar
iCaspar / guessBlue.php
Last active November 5, 2018 15:30
Guess the odds of drawing blue
<?php
/**
* Unit tests for Blue and Red Marbles game.
*
* @see https://www.codewars.com/kata/thinkful-number-drills-blue-and-red-marbles/
*
* You and a friend have decided to play a game to drill your statistical intuitions.
* The game works like this:
* You have a bunch of red and blue marbles.
* To start the game you grab a handful of marbles of each color and put them