I hereby claim:
- I am ozh on github.
- I am ozh (https://keybase.io/ozh) on keybase.
- I have a public key whose fingerprint is C3BF EF81 40E5 59EA F68E 85CB 3DDC 2FE0 1127 13EA
To claim this, I am signing this object:
(function(y,o,u,r,l,s){y.GoogleAnalyticsObject=r,y[r]||(y[r]=function(){(y[r].q=y[r].q||[]).push(arguments)}), | |
y[r].l=+new Date,l=o.createElement(u),s=o.getElementsByTagName(u)[0],l.src="//www.google-analytics.com/analytics.js", | |
s.parentNode.insertBefore(l,s)}(this,document,"script","ga")); | |
ga("create", "UA-XXXXX-X");ga("send", "pageview"); |
#!/bin/sh | |
# return pid of a process | |
[[ $@ ]] || { echo "Usage: pidof <executable, eg prog.exe>"; exit 1; } | |
PIDOF=$(/c/Windows/system32/tasklist | grep "$1" | tr -s " " | cut -d" " -f2) | |
if [ "$PIDOF" != "" ]; then | |
echo $PIDOF; | |
fi |
I hereby claim:
To claim this, I am signing this object:
https://www.google.com/search?q=it%27s+OK | |
https://www.google.com/search?q=it's+nice | |
https://www.google.com/search?q=it\'s+nice | |
https://www.google.com/search?q=it's+very OK | |
https://www.google.com/search?q=hey%jude | |
https://www.google.com/search?q=hey%%jude | |
https://www.google.com/search?q=hey%%%jude | |
https://www.google.com/search?q=url+with+%2525 | |
https://www.google.com/search?q=@OMG (issue 1890) | |
http://blah.com#SoMeThing (issue 1630) |
// Split a string on every URL scheme (protocol) found | |
function split_on_proto( st, tok ) { | |
// Find all protocols (eg 'http://', 'mailto:', 'whatever23://') | |
var protos = st.match( /[a-zA-Z0-9\+\.-]+:\/*/g ); | |
// No protocol found? Return | |
if( !protos ) return st; | |
// Filter array of protocols to get only uniques | |
function aru( value, index, self ) { |
- https://core.trac.wordpress.org/ticket/27736 | |
- Change smilies functions so it can return any text, not just images | |
- add a reset button for the title <-> slug? | |
- to schedule a post: how about a fucking calendar popup? | |
- add a reset button for scheduled posts? |
wp-config.php:
define( 'DISABLE_WP_CRON', true );
Cronjob: one of:
*/15 * * * * wget -q -O - http://www.website.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
*/15 * * * * curl http://www.website.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
*/15 * * * * cd /home/user/public_html; php wp-cron.php > /dev/null 2>&1
<?php | |
$timestart = $timeend = 0; | |
function timer_start() { | |
global $timestart; | |
$timestart = microtime( true ); | |
return true; | |
} | |
function timer_stop( $display = 0, $precision = 5 ) { | |
global $timestart, $timeend; | |
$timeend = microtime( true ); |
<?php | |
/** | |
* Example of how to add and remove filters (or actions) within a plugin class | |
*/ | |
class Add_Remove_Filter { | |
function __construct() { | |
yourls_add_filter( 'ozh', array( $this, 'do_something' ) ); |
<?php | |
class Something { | |
public static $counter; | |
public function meh() { | |
self::$counter = 0; | |
for ( $i = 1; $i <= 5; $i++ ) { | |
$func = function() { ++self::$counter; return true; }; |