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 draw() { // Global function for displaying the game, this is called in a game loop | |
drawVideo(currentVideo); | |
// ... display other elements ... | |
} |
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
{ | |
"notifications": [ | |
{ | |
"service": "email", | |
"subject": "International Lotterie", | |
"content": "Offizieller Benachricht: Sie habe 1 Millon gewonnen!", | |
"onDelete": "0", | |
"onRead": "2" | |
} | |
] |
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
// ... | |
// Match venue | |
$meta_query[] = array( | |
'key' => '_EventVenueID', | |
'value' => $this->find_matching_venue_id( $record ), | |
); | |
// ... |
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 | |
protected function match_existing_post( array $record ) { | |
global $post; | |
$import_id = $this->get_value_by_key( $record, 'event_cost' ); | |
if ( ! empty( $import_id ) && is_numeric( $import_id ) ) { | |
$args = array( | |
'post_status' => 'any', | |
'post_type' => 'any', // circumvent tribe_events filtering of past events | |
'posts_per_page' => 1, |
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
# coding=utf-8 | |
import os | |
import argparse | |
from glob import glob | |
import xml.etree.ElementTree as ET | |
import zipfile | |
namespace = 'urn:oasis:names:tc:xliff:document:1.2' | |
namespaces = {'xliff': namespace} |
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 | |
function sg_get_translated_posts_urls() { | |
$default_lang = apply_filters( 'wpml_default_language', NULL ); | |
$ids = get_posts( array( | |
'fields' => 'ids', | |
'post_type' => array( 'post', 'page' ), | |
'numberposts' => -1, | |
'suppress_filters' => true, // Get posts in all languages | |
) ); |
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 | |
function sdm_export_download_logs_to_csv( $from, $to ) { | |
// Check for valid dates (yyyy-mm-dd) | |
$date_pattern = '/^\d{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])$/'; | |
if ( 1 !== preg_match( $date_pattern, $from ) || 1 !== preg_match( $date_pattern, $to ) ) { | |
return false; | |
} | |
// Check for valid date range | |
if( strtotime( $from ) > strtotime( $to ) ) { |
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
global $enqueued_scripts; | |
global $enqueued_styles; | |
function sg_format_asset_url( $src, $ver ) { | |
// Fallback to WP version, if not set | |
$ver = $ver ? $ver : get_bloginfo( 'version', 'display' ); | |
// Append site root URL, if missing | |
$url = strpos( $src, get_home_url() ) !== false ? $src : get_home_url() . $src; |
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 | |
require __DIR__ . '/vendor/autoload.php'; | |
use Google\GTrends; | |
# This options are by default if none provided | |
$options = [ | |
'hl' => 'en-US', | |
'tz' => -60, # last hour | |
'geo' => 'IE', |
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
wp-env run cli vi .htaccess | |
press "i" | |
add the following: | |
php_value memory_limit 128M | |
php_value post_max_size 128M | |
php_value upload_max_filesize 128M | |
press "ESC" | |
type :wq to save |