Skip to content

Instantly share code, notes, and snippets.

View AD7six's full-sized avatar
:shipit:
Busy shippin'

Andy Dawson AD7six

:shipit:
Busy shippin'
View GitHub Profile
<?php
public $mapMethods = array(
'/findListBy(\w+)/' => 'doSomething'
);
public function doSomething() {
$args = func_get_args();
array_shift($args);
debug(Debugger::trace());
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch 2.4
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: lib/Cake/Controller/Controller.php
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch 2.4
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: lib/Cake/Controller/Controller.php
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
<?php
...
public function index($id = null) {
if (!$id) {
$this->redirect(array('#' => 'showthis'));
}
<?php
$willWork = array(
'one' => 1,
'two' => 2
);
// sizeof($willWork) === 2
$willNotWork = array(
@AD7six
AD7six / gist:5187941
Last active December 15, 2015 02:29
More intuitive version of https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ because "edge.create" means so much
FB.Event.subscribe('confabulation.finikiticate',
function(response) {
alert('You liked the URL: ' + response);
}
);
cd /usr/bin
mv iceweasel xiceweasel
which chrome
ln -s /opt/google/chrome/chrome iceweasel
mv epiphany-browser xepiphany-browser
ln -s /opt/google/chrome/chrome epiphany-browser
mysql> create database so;
Query OK, 1 row affected (0.00 sec)
mysql> use so;
Database changed
mysql> create table example ( y int(4) );
Query OK, 0 rows affected (0.10 sec)
mysql> insert into example values ("1234");
Query OK, 1 row affected (0.08 sec)
[17:29][andy@air:~/projects/cakephp-codesniffer(develop)]$ more tests/files/rhelms1_pass.php
<?php
/**
* If you want to pull everything from a netscape stype ldap server
* iPlanet, Redhat-DS, Project-389 etc you need to ask for specific
* attributes like so. Other wise the attributes listed below wont
* show up
*/
public function setNetscapeEnv() {
[15:28][andy@air:~/projects/cakephp/app(2.2)]$ Console/cake test core AllTests --stderr
Welcome to CakePHP v2.2.0-dev Console
---------------------------------------------------------------
App : app
Path: /Users/andy/projects/cakephp/app/
---------------------------------------------------------------
CakePHP Test Shell
---------------------------------------------------------------
...................S......................................... 61 / 2885 ( 2%)