A fork of the popular open-source contract for web designers and developers by Stuff & Nonsense, reworded for developers
- Originally published: 05/02/2014
- Original post
Between us [company name] and you [customer name]
<?php | |
/* | |
Plugin Name: CWS Posts Per Page | |
Version: 0.1 | |
Description: Sets a custom number of posts to display per page, for specific types of views | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ | |
class CWS_Posts_Per_Page_Plugin { |
<?php | |
/* | |
Plugin Name: Login Logo Custom CSS | |
Description: Custom CSS for the login screen | |
Version: 0.1 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ |
<?php | |
if ( !class_exists( 'CWS_Plugin_v2' ) ) : | |
class CWS_Plugin_v2 { | |
public function hook( $hook ) { | |
$priority = 10; | |
$method = $this->sanitize_method( $hook ); | |
$args = func_get_args(); | |
unset( $args[0] ); | |
foreach ( (array) $args as $arg ) { | |
if ( is_int( $arg ) ) |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 2K bytes over 1 Gbps network 20,000 ns | |
Disk seek (SSD) 100,000 ns | |
Read 1 MB sequentially from memory 250,000 ns | |
Round trip within same datacenter 500,000 ns |
<?php | |
function ernest_marples($postcode) { | |
$postcode = str_replace(" ", "", $postcode); | |
$url = "http://www.uk-postcodes.com/postcode/". urlencode($postcode) .".csv"; // Build the URL | |
$file = file_get_contents($url); | |
if (strpos($file, "html") === FALSE) { // Some error checking - if the file contains html, then we've been redirected to the homepage and something has gone wrong |
Between us [company name] and you [customer name]
/* From Paul Irish */ | |
/* instead of */ | |
setInterval(function(){ doStuff(); },100); | |
/* use anonymous self-executing function */ | |
(function thisismyfunctionuniquename(){ | |
doStuff(); | |
setTimeout(thisismyfunctionuniquename,100); |
<?php | |
function debug_rewrite() { | |
global $wp, $wp_rewrite; | |
if ( !current_user_can( 'manage_options' ) ) | |
return; | |
echo '<pre>'; | |
var_dump( $wp->matched_rule ); | |
print_r( $wp_rewrite ); |
#!/usr/bin/env bash | |
if [ -z "$INSTALL_DIR" ]; then | |
INSTALL_DIR=$HOME/.wp-cli | |
fi | |
mkdir -p "$INSTALL_DIR" | |
cd "$INSTALL_DIR" | |
if [ ! -x composer.phar ]; then |
<!DOCTYPE html> | |
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Breakpoint detection test</title> | |
<style type="text/css" media="screen"> | |
@media screen and (min-width: 320px) { | |
#page:after { | |
content: 'smallest'; /* represent the current width-bracket */ |