Skip to content

Instantly share code, notes, and snippets.

View crishoj's full-sized avatar

Christian Rishøj crishoj

View GitHub Profile
@ivanvermeyen
ivanvermeyen / EnsureQueueListenerIsRunning.php
Last active February 13, 2024 12:40
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
@steverichey
steverichey / Iconizer.sh
Last active February 23, 2022 17:40
Create iOS application icons from one PDF file. Requires ImageMagick.
#!/bin/sh
#
# Iconizer shell script by Steve Richey (srichey@floatlearning.com)
#
# 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 iconizer.sh MyVectorGraphic.pdf MyXcodeProject
#
# Requires ImageMagick: http://www.imagemagick.org/
@ff6347
ff6347 / run_js.sh
Created August 11, 2012 07:43
run javascript in InDesign from command line mac
osascript -e 'tell application "Adobe InDesign CS5" to do script alias "Users:fabiantheblind:Desktop:test:test.jsx" language javascript '''
@jasonreposa
jasonreposa / array_psplice.php
Created January 19, 2012 14:49
Array splice with preserve keys
function array_psplice(&$array, $offset = 0, $length = 1) {
$return = array_slice($array, $offset, $length, true);
foreach ($return as $key => $value) {
unset($array[$key]);
}
return $return;
}
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end