Skip to content

Instantly share code, notes, and snippets.

View crishoj's full-sized avatar

Christian Rishøj crishoj

View GitHub Profile
@crishoj
crishoj / create-vod-hls-gpu.sh
Created September 2, 2023 08:54 — forked from maitrungduc1410/create-vod-hls-gpu.sh
Bash scripts to create VOD HLS stream with ffmpeg using GPU
#!/usr/bin/env bash
START_TIME=$SECONDS
set -e
echo "-----START GENERATING HLS STREAM-----"
# Usage create-vod-hls-gpu.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
# comment/add lines here to control which renditions would be created
renditions=(
@crishoj
crishoj / EnsureQueueWorkerIsRunning.php
Last active August 31, 2020 07:48 — 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: http://laravel.com/docs/scheduling
<?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.';
@crishoj
crishoj / to_sentence.php
Last active July 14, 2016 10:17 — forked from bluefuton/to_sentence.php
Simple implementation of Rails' .to_sentence for PHP
<?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
crishoj / Iconizer.sh
Last active July 7, 2016 09:23 — forked from steverichey/Iconizer.sh
Create iOS application icons from one PDF file. Requires ImageMagick.
#!/bin/sh
#
# Iconizer shell script by Steve Richey ([email protected])
#
# 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/
@crishoj
crishoj / 1.png
Created February 7, 2014 19:45 — forked from jeffkreeftmeijer/1.png
1.png
desc "remotely console"
task :console, :roles => :app do
input = ''
run "cd #{current_path} && rails console #{ENV['RAILS_ENV']}" do |channel, stream, data|
next if data.chomp == input.chomp || data.chomp == ''
print data
channel.send_data(input = $stdin.gets) if data =~ /:\d{3}:\d+(\*|>)/
end
end