This file contains hidden or 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 | |
if ( function_exists( 'the_privacy_policy_link' ) ) { | |
the_privacy_policy_link( '<div>', '</div>'); | |
} |
This file contains hidden or 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 | |
// just a pinch of authorization | |
$sig = hash_hmac('sha1', file_get_contents('php://input'), 'mywebhooksecrethere'); | |
if ( | |
$_POST['payload'] && | |
$_SERVER['HTTP_X_GITHUB_EVENT'] == 'push' && | |
$_SERVER['HTTP_X_HUB_SIGNATURE'] == 'sha1='.$sig | |
) { | |
$cmd = 'cd /var/www/path/to/repo && /usr/bin/git reset --hard HEAD 2>&1 && /usr/bin/git pull 2>&1'; | |
$out = shell_exec( $cmd ); |
This file contains hidden or 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 | |
// Pass a value to a hook in an annonymous function | |
add_shortcode('show_weather',function(){ | |
$a = shortcode_atts( array( | |
'location' => 'Vancouver, BC', | |
), $atts, 'show_weather' ); | |
$city = $a['location']; | |
This file contains hidden or 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
alias please="sudo !!" |
This file contains hidden or 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
// get the HASH values | |
function getHashParams() { | |
var hashParams = {}; | |
var e, | |
a = /\+/g, // Regex for replacing addition symbol with a space | |
r = /([^&;=]+)=?([^&;]*)/g, | |
d = function (s) { return decodeURIComponent(s.replace(a, ' ')); }, | |
q = window.location.hash.substring(1); |
This file contains hidden or 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 | |
S3DIR="s3://BUCKET_NAME" | |
BACKUPPATH=/tmp/backups | |
SITESTORE=/var/www | |
SITE=public_html | |
DATEFORM=$(date +"%Y-%m-%d") | |
DAYSKEEP=7 |
This file contains hidden or 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
body { | |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | |
} |
This file contains hidden or 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 | |
/** | |
* Sword Toolkit configuration | |
* | |
* @see https://github.com/davidsword/sword-toolkit | |
*/ | |
add_filter('sword_toolkit', function() { | |
return [ | |
'remove_blog' => true, |
This file contains hidden or 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 | |
/** | |
* Implements `dsca` command. | |
*/ | |
class DSCA_Helpers { | |
/** | |
* Change a custom post type. | |
* |
This file contains hidden or 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 | |
/** | |
* Use a plugins template file, unless one exists in theme. | |
* | |
* Useful when creating custom post types, allowing themes to create | |
* their own template. | |
*/ | |
add_filter('template_include', function ( $template ) { | |
if ( is_singular( 'location' ) ) { // `location` is a custom post type |