Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Peter Elmered pelmered

🎯
Focusing
View GitHub Profile
@barryvdh
barryvdh / lumen_ide_helper.php
Last active April 10, 2023 10:26
Lumen IDE Helper
View lumen_ide_helper.php
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
@lucasstark
lucasstark / gist:6594983
Created September 17, 2013 14:21
Example to add meta data to woocommerce cart items
View gist:6594983
<?php
/*
* Plugin Name: Example Modify Price
*/
class Example_Modify_Price {
private static $instance;
public static function register() {
if (self::$instance == null) {
@johnpbloch
johnpbloch / README.md
Created August 23, 2012 13:55
A bash script to make .pot files for WordPress plugins
View README.md

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"

@Dynom
Dynom / gist:5866837
Last active December 5, 2017 14:05
Creating ISO 8601-extended in PHP, using DateTime. This includes milliseconds (and if you want, microseconds). Based on the work mentioned here: http://stackoverflow.com/a/4414060/1061927
View gist:5866837
<?php
// Our input
$time = microtime(true);
// Determining the microsecond fraction
$microSeconds = sprintf("%06d", ($time - floor($time)) * 1000000);
// Creating our DT object
$tz = new DateTimeZone("Etc/UTC"); // NOT using a TZ yields the same result, and is actually quite a bit faster. This serves just as an example.