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 | |
if(defined('WP_DEBUG') && WP_DEBUG ){ | |
add_action('wp_footer','debug_print_queries'); | |
add_action('admin_footer','debug_print_queries'); | |
function debug_print_queries(){ | |
global $wpdb; | |
global $wp_object_cache; |
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 | |
/* The new responsive image feature in wordpress 4.4 causes image sourceset attribuet | |
to insert images as HTTP rather than HTTPS. This completely breaks images on sites where | |
the site is loaded ( and in sometimes force-loaded) to be served via HTTPS | |
The following plugin changes these images to be HTTPS if the site is served via HTTPS | |
*/ | |
if ( is_ssl() ) { | |
add_filter('wp_calculate_image_srcset', 'psu_https_srcset_fix' , 100 , 5); | |
} | |
function psu_https_srcset_fix( $sources, $size_array, $image_src, $image_meta, $attachment_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
http://stackoverflow.com/questions/19386962/laravel-eloquent-and-complex-relationships?rq=1 | |
http://forumsarchive.laravel.io/viewtopic.php?pid=21255 | |
http://stackoverflow.com/questions/20666490/laravel-4-mssql-stored-procedure-with-parameters-as-a-prepared-statements | |
http://culttt.com/2013/08/05/extending-eloquent-in-laravel-4/ | |
http://www.blogosfera.co.uk/2013/08/pass-parameters-in-insert-query-stored-procedure-in-laravel-4/ |
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
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: redis-cluster-service | |
spec: | |
type: NodePort | |
selector: | |
app: redis-cluster | |
ports: |
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
--- | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: redis-pv-01 | |
spec: | |
capacity: | |
storage: 1Gi | |
volumeMode: Filesystem | |
accessModes: |
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
--- | |
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: redis-config | |
data: | |
maxmemory: 2mb | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment |
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
gcloud container clusters create "cluster-1" | |
--project <PROJECT-ID> | |
--zone <ZONE-ID> | |
--no-enable-basic-auth | |
--cluster-version "1.20.10-gke.1600" | |
--release-channel "stable" | |
--machine-type "e2-medium" | |
--image-type "UBUNTU" | |
--disk-type "pd-standard" | |
--disk-size "100" |
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 | |
for project in $(gcloud projects list --format="value(projectId)") | |
do | |
echo "============================ Project: $project ============================" | |
mkdir $(pwd)/users/${project} | |
for instance in $(gcloud compute instances list --project $project --filter="STATUS=RUNNING" --format="csv[no-heading](name,zone)") | |
do | |
zone=(${instance//,/ }) | |
read -p "You need ${zone[0]} ?" yn | |
case $yn in |
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
from subprocess import Popen, PIPE | |
from sys import argv | |
import platform | |
import datetime | |
class Janitor: | |
start = 0 | |
end = 0 |