For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
// CustomTime provides an example of how to declare a new time Type with a custom formatter. | |
// Note that time.Time methods are not available, if needed you can add and cast like the String method does | |
// Otherwise, only use in the json struct at marshal/unmarshal time. | |
type CustomTime time.Time | |
const ctLayout = "2006-01-02 15:04:05 Z07:00" | |
// UnmarshalJSON Parses the json string in the custom format | |
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error) { |
#OSX Tweaks: | |
=========== | |
- Most need reboot to show changes | |
- Most of these tweaks are just for speed, but some are specific for development | |
- All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign. | |
- I'm not responsible for any adverse effects to your computer, at all. | |
##Increase the speed of OS X dialogs boxes: |
import os | |
import re | |
def fish_to_zsh(cmd): | |
return (cmd.replace('; and ', '&&') | |
.replace('; or ', '||')) | |
with open(os.path.expanduser('~/.zsh_history.test'), 'a') as o: | |
with open(os.path.expanduser('~/.local/share/fish/fish_history')) as f: | |
for line in f: |
// Intercepting HTTP calls with AngularJS. | |
angular.module('MyApp', []) | |
.config(function ($provide, $httpProvider) { | |
// Intercept http calls. | |
$provide.factory('MyHttpInterceptor', function ($q) { | |
return { | |
// On request success | |
request: function (config) { | |
// console.log(config); // Contains the data about the request before it is sent. |
<?php | |
/** | |
* Loop Add to Cart -- with quantity and AJAX | |
* requires associated JavaScript file qty-add-to-cart.js | |
* | |
* @ref: http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/ | |
* @ref: https://gist.github.com/mikejolley/2793710/ | |
*/ | |
// add this file to folder "woocommerce/loop" inside theme |
// Create color style options | |
add_theme_support( | |
'genesis-style-selector', | |
array( | |
'latent-blue' => __( 'Blue', CHILD_DOMAIN ), | |
'latent-green' => __( 'Green', CHILD_DOMAIN ), | |
'latent-orange' => __( 'Orange', CHILD_DOMAIN ), | |
'latent-red' => __( 'Red', CHILD_DOMAIN ), | |
) | |
); |