Skip to content

Instantly share code, notes, and snippets.

Tobias Krischer tobikris

Block or report user

Report or block tobikris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tobikris
tobikris / gist:2d709777024b7bc40370
Created Jun 25, 2015
Artisan Command Progressbar
View gist:2d709777024b7bc40370
<?php
$progressBar = $this->output->createProgressBar(count($users));
$progressBar->setEmptyBarCharacter(' ');
$progressBar->setProgressCharacter('>');
$progressBar->setBarCharacter('-');
$progressBar->start();
foreach ($users as $user) {
$this->performTask($user);
@tobikris
tobikris / friends_of.sql
Created Jun 11, 2015
SQL SELECT for bi-directional friends
View friends_of.sql
SELECT
IF(`user_id`="1",`user_id`,`friend_id`) AS `user_id`,
IF(`user_id`="1",`friend_id`,`user_id`) AS `friend_id`,
`user_id` AS `source_id`
FROM
friends
WHERE
`user_id`="1"
OR
`friend_id`="1"
@tobikris
tobikris / Charset
Created Jun 8, 2014
.htaccess Examples
View Charset
AddDefaultCharset utf-8
You can’t perform that action at this time.