Skip to content

Instantly share code, notes, and snippets.

View mathiasgrimm's full-sized avatar

Mathias Grimm mathiasgrimm

View GitHub Profile
<?php
interface HandlerInterface
{
public function handle($message);
}
interface BufferedHandlerInterface extends HandlerInterface
{
public function flush();
@mathiasgrimm
mathiasgrimm / Category.sql
Created November 18, 2016 12:59 — forked from ticean/Category.sql
A series of queries for selecting Magento entity EAV attributes, and their values. Lots of union here...
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION
# grep will be use if one argument is provided
# eg.: sshs prod
# this will only output hosts that have prod in their name
if [ "$#" -ne 1 ]
then
cat ~/.ssh/config|grep 'Host '|awk -F ' ' '{print $2}'
else
cat ~/.ssh/config|grep 'Host '|awk -F ' ' '{print $2}'|grep $1
fi
'options' => array(
// make sure to define the same in your my.cnf to ensure that every client (heidisql, mysqlworkbench, etc...)
// will be using it
PDO::MYSQL_ATTR_INIT_COMMAND => "SET sql_mode = 'TRADITIONAL'"
)
CREATE TABLE `job` (
`id` INT(10) UNSIGNED NOT NULL,
`title` VARCHAR(255) NOT NULL,
`location` VARCHAR(255) NULL DEFAULT NULL,
`description` TEXT NOT NULL,
`status` ENUM('DRAFT','PENDING','PUBLISHED','REJECTED','FILLED') NOT NULL,
`contact_email` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NULL DEFAULT NULL,
`email_subject_prefix` VARCHAR(255) NULL DEFAULT NULL,
`adverstiser_name` VARCHAR(255) NULL DEFAULT NULL,
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class EnvGen extends Command {
/**
and (
id like ?
or title like ?
or location like ?
or description like ?
or company_name like ?
or company_url like ?
)
";
if ( ! function_exists('dd'))
{
/**
* Dump the passed variables and end the script.
*
* @param mixed
* @return void
*/
function dd()
{
diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php
index cb3de29..a8da812 100755
--- a/src/Illuminate/Database/Schema/Blueprint.php
+++ b/src/Illuminate/Database/Schema/Blueprint.php
@@ -633,7 +633,7 @@ class Blueprint {
{
$this->timestamp('created_at');
- $this->timestamp('updated_at');
+ $this->timestamp('updated_at')->nullable();