Skip to content

Instantly share code, notes, and snippets.

View chrishieu's full-sized avatar
🧑‍🚒
keep calm and stay focused

chrishieu

🧑‍🚒
keep calm and stay focused
View GitHub Profile
<?php
/**
* @package php-font-lib
* @link https://github.com/PhenX/php-font-lib
* @author Fabien MÈnager <fabien.menager@gmail.com>
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
*/
include 'FontLib/Autoloader.php';
use FontLib\Font;
<?php
$weights = array(
strtolower( 'UltraLight' ) => 100,
strtolower( 'UltraLight Italic' ) => 100,
strtolower( 'Ultra Light' ) => 100,
strtolower( 'Ultra Light Italic' ) => 100,
strtolower( 'Thin' ) => 100,
strtolower( 'ThinItalic' ) => 100,
strtolower( 'Thin Italic' ) => 100,
strtolower( 'ExtraLight' ) => 200,
object(FontLib\EOT\File)[1]
public 'header' => null
private 'tableOffset' (FontLib\TrueType\File) => int 0
protected 'directory' =>
array (size=0)
empty
protected 'data' =>
array (size=0)
empty
protected 'glyph_subset' =>
{
"success": true,
"data": {
"menu": [
{
"name": "Main menu",
"slug": "main-menu",
"item": [
{
"title": "Contact",
{
"success": true,
"data": {
"title": "Center for Protein Reasearch",
"organization": "Novo Foundation",
"description": "editor text",
"big_letter": "B",
"show_frontpage_slideshow": false,
}
}
{
"success": true,
"data": {
"title": "input text",
"description": "text area",
"content": "editor text",
"show_frontpage_slideshow": false,
"sliders": [
{
"title": "Center for Protein Reasearch",
{
"success": true,
"data": {
"slideshow": [
{
"style": 1,
"position": 0/1,
"background_image": ["width", "height", "src"],
"title": "input text",
"teaser": "text area",
{
"success": true,
"data": {
"title": "Center for Protein Reasearch",
"description": "editor text",
"big_letter": "B",
"show_frontpage_slideshow": false,
"initiative_list": [
{
"image": ["src", "width", "height"],
@chrishieu
chrishieu / product-variants.php
Created June 9, 2017 09:52
Create WooCommerce variations with PHP
<?php
// In a class constructor
$this->size_tax = wc_attribute_taxonomy_name( 'Size' );
$this->color_tax = wc_attribute_taxonomy_name( 'Color' );
// Insert the main product first
// It will be used as a parent for other variations (think of it as a container)
$product_id = wp_insert_post( array(
'post_type' => 'product',
'post_title' => $product_title,
'post_content' => $product_content,
@chrishieu
chrishieu / maersk_config.notes
Last active September 26, 2017 09:56
db-config.php, ip_check.json, federation.ini
// ../config/db-config.php
<?php
define('DEVELOPMENT_ENVIRONMENT', 1);
define('DB_NAME', 'maersk_greetings');
if (DEVELOPMENT_ENVIRONMENT == 0) { //localhost
define('BASE_URL', 'http://maersk-card-generator-v2.etypes/');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');