Skip to content

Instantly share code, notes, and snippets.

@tolawho
tolawho / extend-rest-api.php
Created October 19, 2020 16:34 — forked from mklasen/extend-rest-api.php
Update Custom Post Type Meta Fields with the WordPress REST API
<?php
register_meta('post', 'custom-field', [
'object_subtype' => 'custom-post-type',
'show_in_rest' => true
]);
void POST_LINE_Message_To_Server(string message)
{
char message_data[], result[];
string RequestMethod = "POST";
string headers = "Content-Type: application/x-www-form-urlencoded" + "\r\n";
headers += "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "\r\n";
int timeout = 10000;
string result_headers = NULL;
string message_text = "message=";
message_text += message;
@tolawho
tolawho / webpack.mix.js
Created April 1, 2020 17:41 — forked from epixian/webpack.mix.js
Laravel Mix / Tailwind UI / PurgeCSS configuration
const mix = require('laravel-mix');
require('laravel-mix-tailwind');
require('laravel-mix-purgecss');
/* Moment.js bloat */
const webpack = require('webpack');
mix.webpackConfig({
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
]
@tolawho
tolawho / docker.md
Created March 8, 2020 03:58 — forked from f3l1x/aliases
Docker - installation, tips, commands, aliases

Docker

Shortcuts

$ curl -fsSL https://raw.github.com/tcnksm/docker-alias/master/zshrc >> ~/.bashrc && source ~/.bashrc
# ------------------------------------
@tolawho
tolawho / .bashrc
Created September 17, 2018 11:07 — forked from wzup/.bashrc
alias for Git Bash on Windows
# create a file C:\Users\[user]\.bashrc
# add this content
# add your onw aliases or changes these ones as you like
# to make a dot (.bashrs) file in windows, create a file ".bashrs." (without extention) and save. windows will save it as ".bashrc"
alias ls='ls -alh'
alias cdnginx='cd /c/nginx && ls'
alias cdmcga='cd /c/Users/[user]/sbox/node/mcga && ls'
alias cdfood9='cd /c/Users/[user]/sbox/node/food9 && ls'
alias cdmysql='cd /c/nginx/mysql/bin && ls'
@tolawho
tolawho / traversing-example.md
Created August 17, 2017 07:46 — forked from etrepat/traversing-example.md
Traversing the Hierarchy Tree with Baum - An Example

The simplest way to traverse the hierarchy tree with Baum is by iterating through the children relation.

<?php

$root = Category::roots()->with('children')->first();

echo "<h3>{$root->name}</h3>";

foreach($root->children as $category) {