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
Show hidden characters
[ | |
{ "keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} }, | |
{ "keys": ["super+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} }, | |
] |
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 | |
echo -e "Message: \c " | |
read message | |
echo $message | ssh -i ~/.ssh/rsa.pem user@host "cat > /var/www/message.txt" | |
echo -e "Done.\n\n" |
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 | |
date_default_timezone_set('America/Vancouver'); | |
if ( date('G') > 7 && date('G') < 19 ) { // only update between 7am and 7pm | |
require('slack-api.php'); // via Yong Zhen <yz@stargate.io>: https://github.com/10w042/slack-api/blob/master/Slack.php | |
// authentication | |
$token = 'xxxx-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxx'; | |
// options |
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
<h2>Recent Emails</h2> | |
<?php | |
$service = new Google_Service_Gmail($client); | |
$results = $service->users_messages->listUsersMessages('me',array('maxResults' => 5)); | |
$messageList = $results->getMessages(); | |
$inboxMessage = array(); |
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 | |
$restricted = array( | |
56834 => 67, // user id => page id | |
56832 => 764, // user id => page id | |
56901 => 'ai1ec_event', // user id => post_type | |
); | |
// SOME CSS ------------------------------------------------------------ | |
add_action('admin_head',function () { |
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 | |
header('Location: http://localhost/phpmyadmin/'.(strnatcmp(phpversion(),'5.5.0') >= 0 ? "new" : "old")."/"); | |
?> |
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('wc_square_loaded',function(){ | |
if (class_exists('Woocommerce_Square')) { | |
add_action( 'plugins_loaded', function(){ | |
// get WooCommerce_Square | |
$wcsm = Woocommerce_Square::instance(); | |
// startup, (aka `Woocommerce_Square::init()` rebuilt) |
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 el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
withAPIData = wp.components.withAPIData; | |
registerBlockType( 'sandbox/myblock', { | |
title: 'My Block', | |
icon: 'archive', | |
category: 'widgets', | |
// representation of the block in the editor's context |
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('body_class', function($classes){ | |
if (function_exists('the_gutenberg_project') && gutenberg_post_has_blocks( get_the_ID() ) ) | |
$classes[] = 'using-gutenberg'; | |
return $classes; | |
}); |
OlderNewer