Skip to content

Instantly share code, notes, and snippets.

Christian Rishøj crishoj

Block or report user

Report or block crishoj

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
crishoj /
Created Aug 14, 2019
Privacy Policy for Thai-English Dictionary from

Christian Rishøj built the Thai-English Dictionary from app as a free app.

No personal information is collected by the app, and no third party services are used.

Log data remains on the device on which the app is installed, and is not transmitted elsewhere.

Please direct any questions or suggestions to

crishoj / output.txt
Last active Jul 22, 2018
ImageMagick pixel color extraction from CMYK image
View output.txt
## Ubuntu Bionic with PHP 7.2.7 and ImageMagick 6.9.7
>>> $resource = new Imagick("tests/images/bookcover.jpg")
=> Imagick {#2286}
>>> $resource->getImagePixelColor(20, 20)->getColor(true)
=> [
"r" => 0.0,
"g" => 0.10196078431373,
crishoj / example.mbox
Created Feb 24, 2018
Example mail triggering `"Undefined property: stdClass::$bytes"` in
View example.mbox
Received: by with SMTP id t188csp550289vke;
Fri, 23 Feb 2018 04:34:11 -0800 (PST)
X-Google-Smtp-Source: AG47ELugto9uFG3a2nqQcrY8q4WwyaEz+mG9hxyxkeVPh5KGmyTbm0UPd9SG8RZOaZ1vxuiBSvvW
X-Received: by with SMTP id j22mr1221583lja.27.1519389251617;
Fri, 23 Feb 2018 04:34:11 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1519389251; cv=none;; s=arc-20160816;
crishoj / EnsureQueueWorkerIsRunning.php
Last active May 27, 2019 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel 5.5 queue worker is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job:
View EnsureQueueWorkerIsRunning.php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueWorkerIsRunning extends Command
protected $signature = 'queue:checkup';
protected $description = 'Ensure that the queue worker is running.';

Keybase proof

I hereby claim:

  • I am crishoj on github.
  • I am crishoj ( on keybase.
  • I have a public key ASAkPv-nLbCvA-deaFI2NKwV47Nz8gQXni4c9VZLCxpWAwo

To claim this, I am signing this object:

crishoj / fast_paginate.php
Created May 17, 2017
Paginate Eloquent query using SQL_CALC_FOUND_ROWS and FOUND_ROWS() — avoids running the query twice
View fast_paginate.php
function paginateOptimized(Builder $builder, $perPage = null, $pageName = 'page', $page = null): LengthAwarePaginator
$model = $builder->getModel();
$page = $page ?: Paginator::resolveCurrentPage($pageName);
$perPage = $perPage ?: $model->getPerPage();
$sql = $builder->forPage($page, $perPage)->toSql();
crishoj / to_sentence.php
Last active Jul 14, 2016 — forked from bluefuton/to_sentence.php
Simple implementation of Rails' .to_sentence for PHP
View to_sentence.php
if (! function_exists('to_sentence')) {
function to_sentence(array $parts, $connector = ', ', $finally = ' and '): string
switch (count($parts)) {
case 0:
return '';
case 1:
return reset($parts);
crishoj / CamelCasedModel.php
Last active Mar 31, 2016
Eloquent base model for schemas with camel-cased tables and fields
View CamelCasedModel.php
namespace app;
use Illuminate\Database\Eloquent\Model;
class CamelCasedModel extends Model
public function getForeignKey()
crishoj /
Last active Jul 7, 2016 — forked from steverichey/
Create iOS application icons from one PDF file. Requires ImageMagick.
# Iconizer shell script by Steve Richey (
# This is a simple tool to generate all necessary app icon sizes and the JSON file for an *EXISTING* Xcode project from one file.
# To use: specify the path to your vector graphic (PDF format) and the path to your Xcode folder containing Images.xcassets
# Example: sh MyVectorGraphic.pdf MyXcodeProject
# Requires ImageMagick:
You can’t perform that action at this time.