Skip to content

Instantly share code, notes, and snippets.

Discord\Repository\Interaction\OptionRepository Object
(
[give] => Discord\Parts\Interactions\Request\Option Object
(
[name] => give
[type] => 1
[value] =>
[focused] =>
[options] => Discord\Repository\Interaction\OptionRepository Object
(
<?php
public $components = array(
'Paginator',
'RequestHandler',
'DataTable.DataTable' => array(
'Employee' => array(
'columns' => array(
'id' => false, // bSearchable and bSortable will be false
'last_name' => array(
@tigrang
tigrang / gala-mate.patch
Created June 29, 2014 18:49
patch for gala to work with mate
=== modified file 'src/EndSessionDialog.vala'
--- src/EndSessionDialog.vala 2014-06-03 18:20:59 +0000
+++ src/EndSessionDialog.vala 2014-06-05 01:40:33 +0000
@@ -16,7 +16,7 @@
//
// docs taken from unity indicator-session's
-// src/backend-dbus/org.gnome.SessionManager.EndSessionDialog.xml
+// src/backend-dbus/org.mate.SessionManager.EndSessionDialog.xml
[Desktop Entry]
Name=Testing Bug 1072036
Exec=notify-send "Just testing bug 1072036"
Icon=totem.svg
Terminal=false
Type=Application
StartupNotify=true
<?php
class SubdomainRoute extends CakeRoute {
/**
* @var CakeRequest
*/
private $Request;
/**
import os
import xml.etree.cElementTree as ET
wallpapers = ET.Element("wallpapers")
for root, dirs, files in os.walk(os.path.expanduser("~/Pictures")):
for file in files:
if (file.lower().endswith(('.png', '.jpg', '.jpeg'))):
wallpaper = ET.SubElement(wallpapers, "wallpaper")
wallpaper.set("deleted", "false")
name = ET.SubElement(wallpaper, "name")
<?php
App::uses('CakeRoute', 'Routing/Route');
class HyphenRoute extends CakeRoute {
public function parse($url) {
if ($route = parent::parse($url)) {
if (strtolower($route['action'] !== $route['action'])) {
throw new NotFoundException();
}
if (strpos($route['action'], '-') !== false) {
@tigrang
tigrang / gist:3763800
Created September 21, 2012 20:47
A terrible and terribly simple implementation of a route class that matches get params
<?php
App::uses('CakeRoute', 'Routing/Route');
/**
* QueryStringRoute
*
* Usage:
*
* App::uses('QueryRoute', 'Route');
* Router::connect('/', ['controller' => 'users'], ['routeClass' => 'QueryStringRoute', 'query' => ['foo' => 'bar']]);
*
@tigrang
tigrang / gist:3242448
Created August 3, 2012 00:10
Hyphenated actions in urls
<?php
App::uses('CakeRoute', 'Routing/Route');
class HyphenRoute extends CakeRoute {
public function parse($url) {
if ($route = parent::parse($url)) {
// don't allow camel-case actions in url to prevent duplicate urls pointed to same page
if (strtolower($route['action'] !== $route['action'])) {
throw new NotFoundException();
}
diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php
index 42a2937..c1956c5 100644
--- a/lib/Cake/Routing/Router.php
+++ b/lib/Cake/Routing/Router.php
@@ -182,7 +182,10 @@ class Router {
* @throws RouterException
*/
protected static function _validateRouteClass($routeClass) {
- if (!class_exists($routeClass) || !is_subclass_of($routeClass, 'CakeRoute')) {
+ if (