This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.fileContainer { | |
overflow: hidden; | |
position: relative; | |
} | |
.fileContainer [type=file] { | |
cursor: inherit; | |
display: block; | |
font-size: 999px; | |
filter: alpha(opacity=0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Keep me Logged In for 1 Year | |
* Plugin URI: https://bueltge.de/wordpress-login-unterbinden/1220/ | |
* Description: Set the time that the cookie will be kept at 1 year. | |
* Version: 0.0.3 | |
* Author: Frank Bültge | |
* Author URI: https://bueltge.de/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function whichTransitionEvent(){ | |
var t; | |
var el = document.createElement('fakeelement'); | |
var transitions = { | |
'transition':'transitionend', | |
'MSTransition':'msTransitionEnd', | |
'MozTransition':'transitionend', | |
'WebkitTransition':'webkitTransitionEnd' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* From Paul Irish */ | |
/* instead of */ | |
setInterval(function(){ doStuff(); },100); | |
/* use anonymous self-executing function */ | |
(function thisismyfunctionuniquename(){ | |
doStuff(); | |
setTimeout(thisismyfunctionuniquename,100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Function hook jQuery plugin | |
* version 1.0 | |
* author: Damien Antipa | |
* http://github.com/dantipa/ | |
*/ | |
(function(window, $, undefined){ | |
/** | |
* Hooks into a given method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'registered_taxonomy', array( 'APP_Tax_Admin_Column', 'register_column' ), 10, 3 ); | |
/** | |
* Generates a column with the associated terms, | |
* for any taxonomy with 'show_admin_column' => true | |
*/ | |
class APP_Tax_Admin_Column { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper class for controlling all aspects of a view. | |
* | |
* Supported methods (automatically hooked): | |
* - init() - for registering post types, taxonomies, rewrite rules etc. | |
* - parse_query() - for correcting query flags | |
* - pre_get_posts() - for altering the query, without affecting the query flags | |
* - posts_search(), posts_clauses(), posts_request() - for direct SQL manipulation | |
* - the_posts() - for various other manipulations | |
* - template_redirect() - for enqueuing scripts etc. |