Skip to content

Instantly share code, notes, and snippets.

View anthonybudd's full-sized avatar

Anthony C. Budd anthonybudd

View GitHub Profile
import numpy as np;
import tensorflow as tf;
import pylab;
xAxis = []
yAxis = []
def make_data(n):
np.random.seed(42) # To ensure same data for multiple runs
x = 2.0 * np.array(range(n))
<?php
add_filter('show_admin_bar', '__return_false');
<?php
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class ($classes, $item) {
if (in_array('current-menu-item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
<?php
$where = [
'meta_relation' => 'AND',
[
'meta_key' => 'color',
'meta_vale' => 'blue'
],
[
'meta_key' => 'weight',
<?php
$product = Product::find(15);
$product->hardDelete();
echo $product->color; // NULL
<?php
Class Product extends WP_Model
{
...
public $virtual = [
'humanWeight'
];
public $serialize = [
'humanWeight',
<?php
Class Product extends WP_Model
{
...
public function _finderHeavy($agrs){
...
}
public function _postFinderHeavy($results, $args){
return array_map(function($model){
<?php
Class Product extends WP_Model
{
...
public function _finderHeavy($agrs){
return [
'posts_per_page' => '50',
'meta_query' => [
[
'key' => 'weight',
<?php
Class Product extends WP_Model
{
...
public function _finderHeavy(){
return [
'posts_per_page' => '50',
'meta_query' => [
[
'key' => 'weight',
<?php
Class Product extends WP_Model
{
...
public $filter = [
'weight',
];
public function _filterWeight($value){
return intVal($value);