Skip to content

Instantly share code, notes, and snippets.

@zymsys
zymsys / fg_gems.md
Last active Mar 1, 2021
Hidden Gems in Fantasy Grounds
View fg_gems.md

Debug.print()

/debug on

onValueChanged

You can use printstack from this to see why a value has changed. I'd like to build a listener extension fror OOB. Maybe I could support listening for values too. Was going to support listening for dice rolls.

Session.isHost

This is a variable, so is faster than User.isHost(). All the cool kids are using it.

@zymsys
zymsys / journal.md
Last active Nov 5, 2015
DBAL & MySQL JSON
View journal.md

When I have a table in a database which has a json column I can't use doctrine:schema:update --force because I get this error:

[Doctrine\DBAL\DBALException]
Unknown database type json requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.

Break on exception shows this happening at \Doctrine\DBAL\Platforms\AbstractPlatform\getDoctrineTypeMapping because 'json' can't be found in $this->doctrineTypeMapping. This is initialized by the abstract function initializeDoctrineTypeMappings which in this case is implemented in \Doctrine\DBAL\Platforms\MySqlPlatform. Sure enough there is no 'json' key.

It looks like the array keys are native column types, and the array values are DBAL column types.

I know that mysql has a 'json' column type, and I know that DBAL has a 'json_array' column type. Let's take a shot in the dark...

@zymsys
zymsys / php-version-apache.md
Created Mar 30, 2015
Change Apache PHP version with php-version
View php-version-apache.md

This gist assumes that you've followed these instructions to set up your AMP on OS X, and that you're using php-version to change PHP versions as needed.

Note that I have selected the wrong tool for the job with php-version. However once I got this working I wanted to document it in case I want to replicate the config without selecting a more appropriate tool. If you stumble upon this gist and decide to find a better tool for the job I'd appreciate a comment directing myself and others to something better.

Now if you're sure you want to drive a square peg into a round hole, continue reading...

First, modify php-version to run a post version change script when php versions are changed.

$ vi $(brew --prefix php-version)/php-version.sh
@zymsys
zymsys / gist:23c0d7824730a2aa2063
Created Nov 1, 2014
Notes from my October 2013 Composer Talk for GTA-PHP
View gist:23c0d7824730a2aa2063
Assemble Johnny's dependencies from scratch using composer.
Vics-MacBook-Pro:johnnydo vic$ composer init
Welcome to the Composer config generator
@zymsys
zymsys / keybase.md
Created Sep 22, 2014
Keybase.io Proof
View keybase.md

Keybase proof

I hereby claim:

  • I am zymsys on github.
  • I am vicm (https://keybase.io/vicm) on keybase.
  • I have a public key whose fingerprint is 46A0 F35E 028B 3130 3C52 63EF FA6F 2354 E070 12F5

To claim this, I am signing this object:

@zymsys
zymsys / square.png
Last active Aug 29, 2015
Square Signup Issue
View square.png
#Chrome
Version 32.0.1700.102
Google Chrome is up to date.
Cache cleared
Results in the following error when form is submitted (matching email and a password were filled in).
The password I tried was from a password generator: webEkIjyiv - I'll select another when I really sign up.
@zymsys
zymsys / multiplier_filter.dart
Created Jan 17, 2014
Trying to solve the 'Explore More' challenge from https://github.com/angular/angular.dart.tutorial/wiki/Introducing-filters-and-services, but I can't find the right approach to a filter which modifies the output. This loops forever because the list is changed by the filter. For now this just prepends an x to each ingredient. This is a placeholde…
View multiplier_filter.dart
library multiplier_filter;
import 'package:angular/angular.dart';
import '../recipe.dart';
@NgFilter(name: 'multiplierfilter')
class MultiplierFilter {
call(recipeList, multiplier) {
if (recipeList is List && multiplier is int) {
var result = recipeList.map((recipe) {
@zymsys
zymsys / gist:4176392
Created Nov 30, 2012
Creating a Composer Package with its own Dependency
View gist:4176392
I'm trying to set up composer for a package I maintain called Zymurgy:CM, which is on github but not on packagist. I created a 'composer' branch which has the following composer.json file:
{
"name": "zymurgy/zymurgy-cm",
"type": "library",
"description": "Zymurgy:CM Content Management",
"license":"MIT",
"authors": [
{
"name": "Vic Metcalfe",
@zymsys
zymsys / events.js
Created Apr 21, 2012
Meteor First Impressions
View events.js
Template.leaderboard.events = {
'click input.inc': function () {
Players.update(Session.get("selected_player"), {$inc: {score: 5}});
},
'click #sort': function () {
Session.set("sort_by_name", !Session.get("sort_by_name"));
}
};
View trafficlight_ocp.rb
class TrafficLightDisplay
def showState(state)
puts state == :LIGHT_STATE_RED ? "* RED *" : " red"
puts state == :LIGHT_STATE_AMBER ? "* AMBER *" : " amber"
puts state == :LIGHT_STATE_GREEN ? "* GREEN *" : " green"
puts "---------"
end
end
class TrafficLight