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 | |
// apitest.php | |
// by Karl Kranich - karl.kranich.org | |
// version 3.1 - edited query section | |
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php'); | |
include_once "google-api-php-client/examples/templates/base.php"; | |
$client = new Google_Client(); |
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
app.directive('dynamicHeight', function() { | |
return { | |
require: ['^ionSlideBox'], | |
link: function(scope, elem, attrs, slider) { | |
scope.$watch(function() { | |
return slider[0].__slider.selected(); | |
}, function(val) { | |
//getting the heigh of the container that has the height of the viewport | |
var newHeight = window.getComputedStyle(elem.parent()[0], null).getPropertyValue("height"); | |
if (newHeight) { |
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
/* | |
Add image by link plugin for Imperavi Redactor v10.x.x | |
Updated: January 21, 2015 | |
Copyright (c) 2015, Alexey Kinev | |
License: The MIT License (MIT) http://opensource.org/licenses/MIT | |
Usage: | |
$('#redactor').redactor({ | |
imageUpload: 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
<?php | |
function send_http_auth_headers(){ | |
header('WWW-Authenticate: Basic realm="Your Website Name Restricted"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
echo 'Please speak to an administrator for access to the this feature.'; | |
exit; | |
} | |
add_action('template_redirect', 'maybe_add_http_auth_basic', 0); | |
function maybe_add_http_auth_basic(){ | |
# Add your specific URI segment (i.e. http://example.com/segment-string/) |
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 | |
/** | |
* Force WP JSON REST API endpoints to always be served over HTTPS | |
* | |
* @action wp_json_server_before_serve | |
* | |
* @return void | |
*/ | |
function fjarrett_wp_json_force_ssl() { |
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
# Delete all posts with given post type | |
DELETE FROM wp_posts WHERE post_type = 'shop_order'; | |
# Delete all orphaned post_meta | |
DELETE wp_postmeta FROM wp_postmeta | |
WHERE NOT EXISTS ( | |
SELECT * FROM wp_posts | |
WHERE wp_postmeta.post_id = wp_posts.ID | |
); |
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
/** | |
* Programmatically logs a user in | |
* | |
* @param string $username | |
* @return bool True if the login was successful; false if it wasn't | |
*/ | |
function programmatic_login( $username ) { | |
if ( is_user_logged_in() ) { | |
wp_logout(); |
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
upstream xip_app_server { | |
server localhost:8080 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name "~^(?<base_dir>.+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.xip.io$"; | |
access_log /var/log/nginx/xip.access.log main; | |
error_log /var/log/nginx/xip.error.log; |
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
/** | |
* Imperavi Redactor Plugin for Embedding Tweets | |
* for version >= 9.1 | |
* | |
* @author Ilya Chekalskiy <[email protected]> | |
* @version 0.2.2 | |
*/ | |
if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {}; | |
RedactorPlugins.tweets = { |
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
- index.js | |
- package.json | |
- public/js/main.js | |
- public/index.html | |
- css/bootstrap-responsive.min.css | |
- css/flatly-bootstrap.min.css |
NewerOlder