Skip to content

Instantly share code, notes, and snippets.

@zymsys
zymsys / square.png
Last active August 29, 2015 13:55
Square Signup Issue
#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 / keybase.md
Created September 22, 2014 17:33
Keybase.io Proof

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 / gist:23c0d7824730a2aa2063
Created November 1, 2014 22:10
Notes from my October 2013 Composer Talk for GTA-PHP
Assemble Johnny's dependencies from scratch using composer.
Vics-MacBook-Pro:johnnydo vic$ composer init
Welcome to the Composer config generator
@zymsys
zymsys / php-version-apache.md
Created March 30, 2015 21:45
Change Apache PHP version with php-version

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:1595001
Created January 11, 2012 14:52
How I build PHP 5.4 on OSX from source
I had to run find to figure out where bz2.so was:
$ sudo find / -name bz2.so
...
Should turn something up - I hope. Change the eclipse path below to whatever you find. If you can't find anything you might have to install Zend Studio or figure out another source. Then from the PHP source folder:
$ ./configure --enable-mysqlnd --with-gd --enable-mbstring --with-bz2=/Applications/eclipse/plugins/org.zend.php.debug.debugger.macosx_5.3.7.v20091124/resources/php5/ext/ --with-zlib --with-curl --with-curlwrappers
$ make
@zymsys
zymsys / fiddle.response.json
Created January 23, 2012 00:53
Demo JSON data
[
{
"name":"Tanner Young",
"phones":[
{
"name": "home",
"number": "1-802-826-8704"
},
{
"name": "fax",
@zymsys
zymsys / LSPExampleViolation.php
Created March 8, 2012 03:11
Rectangle / Square LSP Example Violation in PHP
<?php
class Rectangle
{
private $_width;
private $_height;
public function getWidth()
{
return $this->_width;
@zymsys
zymsys / DIP.php
Created April 8, 2012 15:53
SOLID Sample Code
<?php
class FooControllerConventional
{
function indexView() {
$model = new FooModel();
$viewData = $model->fetchAll();
$view = new FooView();
$view->render($viewData);
}
}
@zymsys
zymsys / trafficlight_ocp.rb
Created April 14, 2012 19:01
SRP and OCP example
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
@zymsys
zymsys / events.js
Created April 21, 2012 05:53
Meteor First Impressions
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"));
}
};