Skip to content

Instantly share code, notes, and snippets.

View martin-juul's full-sized avatar
🇩🇰
Coding

Martin Juul martin-juul

🇩🇰
Coding
View GitHub Profile

macOS Developer Box - Up and Running

Below is my personal recommendations on setting up a workable development environment on macOS. This topic is like discussing religion or politics. There's no right answer, only opinions.

If you learned something useful then great! If you think i'm an idiot, then that's cool too! :)

IDE

-Dfile.encoding=UTF-8
-Dide.no.platform.update=true
-Didea.config.path=$USER_HOME/.jetbrains/phpstorm/config
-Didea.system.path=$USER_HOME/.jetbrains/phpstorm/system
-Didea.plugins.path=$USER_HOME/.jetbrains/phpstorm/config/plugins
-Didea.log.path=$USER_HOME/.jetbrains/phpstorm/system/log
-server
@martin-juul
martin-juul / AbstractProcess.php
Last active December 7, 2019 21:42
hls live transcoding
<?php
namespace App\Transcode\FFMpeg;
use Illuminate\Support\Arr;
use Symfony\Component\Process\Process;
abstract class AbstractProcess
{
abstract protected function getBinaryPath(): string;

Installing ipFire on a Raspberry Pi 3 b+

Sharp language ahead, but i was infuriated at getting openWRT to work before this. Go away if you're easily offended.

Step 1: Download ipFire

I have mirrored the version I've been using for this guide. Though i encourage you to download the latest one.

Mirror: https://drive.google.com/open?id=1u--Ynws2FTW4X1oycYXp2xOZ4B8pvRt6

# Read a single char from /dev/tty, prompting with "$*"
# Note: pressing enter will return a null string. Perhaps a version terminated with X and then remove it in caller?
# See https://unix.stackexchange.com/a/367880/143394 for dealing with multi-byte, etc.
get_keypress() {
local REPLY IFS=
printf >/dev/tty '%s' "$*"
[[ $ZSH_VERSION ]] && read -rk1 # Use -u0 to read from STDIN
# See https://unix.stackexchange.com/q/383197/143394 regarding '\n' -> ''
[[ $BASH_VERSION ]] && read </dev/tty -rn1
printf '%s' "$REPLY"
@martin-juul
martin-juul / common.bash
Last active September 20, 2019 11:28
Common bash helpers These snippets are meant for large deployments, so if something is marked as *standard* - do not change those values Before you start I know it tempting to use csh, fish, zsh etc.. - but the fact of the matter is, if youre lu
#!/usr/bin/env bash
# Battle tested for macOs deploy scripts
# disable builtin echo so we can use '-en'
enable -n echo
# Get the real path to the location of the script
shopt -s nullglob
DIR=$(
@martin-juul
martin-juul / .zshrc
Last active September 1, 2019 17:35
#!/usr/bin/env zsh
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
fpath=(/usr/local/share/zsh-completions $fpath)
fi
export HOMEBREW_NO_ANALYTICS=1
export PATH="/usr/local/opt/bison/bin:$PATH"
@martin-juul
martin-juul / install_php
Created September 1, 2019 14:42
phpbrew helper
#!/usr/bin/env bash
PHP_VERSION=${1}
if [[ -z $PHP_VERSION ]]; then
echo "You must specify a php version. Eg: install-php 7.3"
exit 1
fi
echo "Installing PHP ${PHP_VERSION}"
# $OpenBSD: ssh_config,v 1.33 2017/05/07 23:12:57 djm Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
@martin-juul
martin-juul / install-ffmpeg-brew.sh
Created July 24, 2018 14:31
Install ffmpeg with all extras on macOS with Homebrew
#!/usr/bin/env bash
brew install ffmpeg $(brew options ffmpeg | grep -vE '\s' | grep -- '--with-' | tr '\n' ' ')