Skip to content

Instantly share code, notes, and snippets.

View Developer Contract Killer 1.md

Development Contract Killer

A fork of the popular open-source contract for web designers and developers by Stuff & Nonsense, reworded for developers


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

@scribu
scribu / package-setup.sh
Created Dec 24, 2013
Set up the package index for WP-CLI
View package-setup.sh
#!/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
@davatron5000
davatron5000 / Sublime Text Setup.md
Last active Oct 2, 2020
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.
View Sublime Text Setup.md

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@justintadlock
justintadlock / register-post-type.php
Last active Oct 2, 2020
Help file when registering post types.
View register-post-type.php
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@simonwhitaker
simonwhitaker / postcode-regex.js
Last active Dec 6, 2019
An example of using a simplified UK postcode regex in Javascript
View postcode-regex.js
var tweet = "Currently chilling out at W1B 2EL, then on to WC2E 8HA or maybe even L1 8JF! :-)";
// Here's a simple regex that tries to recognise postcode-like strings.
// See http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation
// for the rules on how UK postcodes are formatted.
var postcode_regex = /[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}/g;
var postcodes = tweet.match(postcode_regex);
console.log(postcodes);
@barneycarroll
barneycarroll / fileInput.css
Last active Aug 19, 2020
Total input[type=file] style control with pure CSS. File type inputs are notoriously hard to style, due to different semi-serious style restrictions in the name of security (the argument being that a file input presents access to the user's private file system, and should as such always look unambiguously like what it is — redundant if you ask m…
View fileInput.css
.fileContainer {
overflow: hidden;
position: relative;
}
.fileContainer [type=file] {
cursor: inherit;
display: block;
font-size: 999px;
filter: alpha(opacity=0);
@bueltge
bueltge / keep_me_logged_in_for_1_year.php
Last active Dec 8, 2017
WordPress Plugin, that set the time that the cookie will be kept at 1 year and active the 'Rember Me' Checkbox for default
View keep_me_logged_in_for_1_year.php
<?php
/**
* Plugin Name: Keep me Logged In for 1 Year
* Plugin URI: http://bueltge.de/wordpress-login-unterbinden/1220/
* Description: Set the time that the cookie will be kept at 1 year.
* Version: 0.0.2
* Author: Frank Bültge
* Author URI: http://bueltge.de/
*/
View transition_sniffing.js
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'MSTransition':'msTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
@bueltge
bueltge / attachment-taxononimies.php
Created Dec 6, 2012
WordPress Attachment Taxonomies with WP 3.5*
View attachment-taxononimies.php
<?php
/**
* Plugin Name: Attachment Taxonomies
* Plugin URI: attachment_taxonomies
* Text Domain: addquicktag
* Domain Path: /languages
* Description:
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
@Raysharr
Raysharr / better_setInterval.js
Created Oct 18, 2012
Paul Irish's better setInterval
View better_setInterval.js
/* From Paul Irish */
/* instead of */
setInterval(function(){ doStuff(); },100);
/* use anonymous self-executing function */
(function thisismyfunctionuniquename(){
doStuff();
setTimeout(thisismyfunctionuniquename,100);
You can’t perform that action at this time.