Skip to content

Instantly share code, notes, and snippets.

View mchelen's full-sized avatar

Mike Chelen mchelen

View GitHub Profile
@mchelen
mchelen / .htaccess
Last active June 6, 2016 19:45
apache 2.2
RewriteEngine on RewriteRule .* good.html
$ drush sql-dump > test.sql
$ drush sql-drop -y && drush sql-cli < test.sql
Do you really want to drop all tables in the database sites/default/files/.ht.sqlite? (y/n): y
Error: near line 1837: no such collation sequence: NOCASE_UTF8
Error: near line 1843: no such table: users
Error: near line 1844: no such table: users
Error: near line 1845: no such collation sequence: NOCASE_UTF8
Error: near line 1863: no such table: users_field_data
Error: near line 1864: no such table: users_field_data
Error: near line 1955: no such collation sequence: NOCASE_UTF8
{
"require": {
"drush/drush": "dev-master"
},
"minimum-stability": "dev"
}
{
"require": {
"drush/drush": "^8.1"
}
}
@mchelen
mchelen / gist:b8e6c27dbeb11935b86c0456e5e94d05
Last active April 26, 2016 21:17
The "https://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 503 Service Unavailable)
Exception trace:
() at phar:///home/xubuntu/composer.phar/src/Composer/Util/RemoteFilesystem.php:343
Composer\Util\RemoteFilesystem->get() at phar:///home/xubuntu/composer.phar/src/Composer/Util/RemoteFilesystem.php:99
Composer\Util\RemoteFilesystem->getContents() at phar:///home/xubuntu/composer.phar/src/Composer/Repository/ComposerRepository.php:645
Composer\Repository\ComposerRepository->fetchFile() at phar:///home/xubuntu/composer.phar/src/Composer/Repository/ComposerRepository.php:462
Composer\Repository\ComposerRepository->loadRootServerFile() at phar:///home/xubuntu/composer.phar/src/Composer/Repository/ComposerRepository.php:256
Composer\Repository\ComposerRepository->hasProviders() at phar:///home/xubuntu/composer.phar/src/Composer/DependencyResolver/Pool.php:99
Composer\DependencyResolver\Pool->addRepository() at phar:///home/xubuntu/composer.phar/src/Composer/Installer.php:402
Composer\Installer->doInstall() at phar:///home/xubuntu/composer.phar/src/Composer/Installer.php:228
Composer\Inst
@mchelen
mchelen / index.php
Last active November 20, 2021 18:01
php check multidimensional array for duplicate values
<?php
$arrays = array(
array(
'name'=>'foo',
),
array(
'name'=>'bar',
),
array(
'name'=>'foo',
@mchelen
mchelen / index.php
Last active March 31, 2016 14:02
php data transform
<?php
$input = array(
array(
'category1' => 'foo',
'category2' => 'bar',
'value' => 5,
),
array(
@mchelen
mchelen / docker-compose.yml
Created March 1, 2016 19:45
drupal docker compose
version: '2'
services:
web:
image: drupal:7.43-apache
volumes:
- .:/var/www/html
links:
- "db:mysql"
ports:
- "80:80"
$ docker-compose up
ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.
@mchelen
mchelen / .gitignore
Last active January 29, 2016 03:04
exception handling in constructor demo
vendor
composer.lock
example.log