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 | |
// Author: Kaspars Dambis <hi@kaspars.net> | |
// Usage: php ms-cron-runner.php --domain=example.com [--path=/path/to/wordpress] | |
// We can't run this reliably from CLI because of how WordPress | |
// relies on $_SERVER for loading functions.php | |
if ( php_sapi_name() !== 'cli' ) | |
die; |
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 | |
$html = file_get_contents( 'http://example.com' ); | |
preg_match_all( '/https?:\/\/(?:www.)?twitter.com\/#?([a-zA-Z0-9_]+)\/?(?![\/a-z]+)/i', $html, $maybe_twitters ); | |
if ( ! empty( $maybe_twitters[1] ) ) { | |
printf( 'Found %s', $maybe_twitters[1][0] ); | |
} else { | |
print( 'Nothing found!' ); |
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
<!doctype html> | |
<html ng-app="timezoneApp"> | |
<head> | |
<title>Team Timezones</title> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> | |
<script> | |
var period = 172800; // 2 days in seconds | |
var now = new Date(); | |
var utc = new Date( now.getTime() + now.getTimezoneOffset() * 60000 ); | |
var seconds_today = utc.getSeconds() + ( 60 * ( utc.getMinutes() + ( 60 * utc.getHours() ) ) ); |
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
#!/bin/bash | |
# | |
# Prepend the current branch name to every commit message. | |
# Prepend the parent issue from JIRA, if found. | |
# | |
# Save this to .git/hooks/prepare-commit-msg and make it exacutable: | |
# chmod +x .git/hooks/prepare-commit-msg | |
# | |
# Extract the current working branch |
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 | |
session_start(); | |
$_SESSION['last_post'] = time(); | |
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR']; | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Online Tools for WordPress Developers</title> |
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( 'wpcf7_before_send_mail', function( $cf7 ) { | |
// Disable form submission for form ID 123 | |
if ( 123 == $cf7->id() ) { | |
remove_action( 'wpcf7_before_send_mail', array( cf7_storage::instance(), 'storage_capture' ) ); | |
} | |
}, 5, 1 ); |
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_filter( 'cf7_entry_rows', function( $rows, $entry ) { | |
$attachments = get_post_meta( $entry->ID, 'mail_attachments', true ); | |
if ( empty( $attachments ) ) { | |
return $rows; | |
} |
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
javascript:void%20function(){var%20e=document.getElementsByTagName(%22link%22);for(li%20in%20e)if(e[li].rel%26%26(-1!==e[li].type.indexOf(%22rss+xml%22)||-1!==e[li].type.indexOf(%22atom+xml%22))%26%26confirm(e[li].href))return%20void%20window.open(%22http://feedly.com/i/subscription/feed/%22+e[li].href,%22_blank%22);alert(%22No%20valid%20feeds%20found!%22)}(); |
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 | |
// Output of gd_info() | |
Array | |
( | |
[GD Version] => bundled (2.1.0 compatible) | |
[FreeType Support] => | |
[GIF Read Support] => 1 | |
[GIF Create Support] => 1 | |
[JPEG Support] => |
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
0x7fff7b564000 14:21:04.140733193388674 [opensc-tool] sc.c:251:sc_detect_card_presence: called | |
0x7fff7b564000 14:21:04.140733193388674 [opensc-tool] reader-pcsc.c:384:pcsc_detect_card_presence: called | |
0x7fff7b564000 14:21:04.642 [opensc-tool] reader-pcsc.c:294:refresh_attributes: OMNIKEY AG Smart Card Reader check | |
0x7fff7b564000 14:21:04.643 [opensc-tool] reader-pcsc.c:313:refresh_attributes: returning with: 0 (Success) | |
0x7fff7b564000 14:21:04.140733193388675 [opensc-tool] reader-pcsc.c:389:pcsc_detect_card_presence: returning with: 5 | |
0x7fff7b564000 14:21:04.643 [opensc-tool] sc.c:256:sc_detect_card_presence: returning with: 5 | |
Using reader with a card: OMNIKEY AG Smart Card Reader | |
0x7fff7b564000 14:21:04.643 [opensc-tool] sc.c:251:sc_detect_card_presence: called | |
0x7fff7b564000 14:21:04.140733193388675 [opensc-tool] reader-pcsc.c:384:pcsc_detect_card_presence: called | |
0x7fff7b564000 14:21:04.643 [opensc-tool] reader-pcsc.c:294:refresh_attributes: OMNIKEY AG Smart Card Reader check |