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
# all logging settins are here on top | |
$logFile = "log-$(gc env:computername).log" | |
$logLevel = "DEBUG" # ("DEBUG","INFO","WARN","ERROR","FATAL") | |
$logSize = 1mb # 30kb | |
$logCount = 10 | |
# end of settings | |
function Write-Log-Line ($line) { | |
Add-Content $logFile -Value $Line | |
Write-Host $Line |
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
## convert HTML POST data or HTTP GET query string to JSON | |
## get the raw post data from the AWS built-in variable and give it a nicer name | |
#if ($context.httpMethod == "POST") | |
#set($rawAPIData = $input.path("$")) | |
#elseif ($context.httpMethod == "GET") | |
#set($rawAPIData = $input.params().querystring) | |
#set($rawAPIData = $rawAPIData.toString()) | |
#set($rawAPIDataLength = $rawAPIData.length() - 1) | |
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength)) |
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
function Create-AesManagedObject($key, $IV) { | |
$aesManaged = New-Object "System.Security.Cryptography.AesManaged" | |
$aesManaged.Mode = [System.Security.Cryptography.CipherMode]::CBC | |
$aesManaged.Padding = [System.Security.Cryptography.PaddingMode]::Zeros | |
$aesManaged.BlockSize = 128 | |
$aesManaged.KeySize = 256 | |
if ($IV) { | |
if ($IV.getType().Name -eq "String") { | |
$aesManaged.IV = [System.Convert]::FromBase64String($IV) | |
} |
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 | |
/** | |
* Plugin Name: Static Templates | |
* | |
* If most of your site content is in .php template files, and you're tired of | |
* creating new pages, assigning them page templates, creating page templates | |
* then doing it all over again on production, this plugin is for you. | |
* | |
* Examples: | |
* |
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 | |
/** | |
* Plugin Name: MU plugins subdirectory loader | |
* Plugin URI: https://gist.github.com/lavoiesl/6302907 | |
* Description: Enables the loading of plugins sitting in mu-plugins (as folders) | |
* Version: 0.1 | |
* Author: [email protected] | |
* Author URI: http://blog.lavoie.sl/ | |
* |
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 | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
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
/* The Grid ---------------------- */ | |
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row.large-collapse .column, | |
.lt-ie9 .row.large-collapse .columns { padding: 0; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row .row.large-collapse { margin: 0; } | |
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |
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
class ParentWalker extends Walker_Nav_Menu { | |
function display_element ( $element, &$children, $max_depth, $depth = 0, $args, &$output ) { | |
$id_field = $this->db_fields['id']; | |
if (!empty($children[$element->$id_field])) { | |
$element->classes[] = 'menu-item-parent'; //enter any classname you like here! | |
} | |
parent::display_element($element, $children, $max_depth, $depth, $args, $output); | |
} | |
} |
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 | |
/** | |
* An example function used to demonstrate how to use the `user_can_save` function | |
* that provides boilerplate security checks when saving custom post meta data. | |
* | |
* The ultimate goal is provide a simple helper function to be used in themes and | |
* plugins without the need to use a set of complex conditionals and constants. | |
* | |
* Instead, the aim is to have a simplified function that's easy to read and that uses | |
* WordPress APIs. |
NewerOlder