Skip to content

Instantly share code, notes, and snippets.

View viezel's full-sized avatar

Mads Møller Schrøder viezel

View GitHub Profile
@viezel
viezel / README.md
Last active July 30, 2018 13:21 — forked from manuelselbach/README.md
xdebug docker on macOS with PhpStorm

Use xdebug with docker on macOS and PhpStorm

To use xdebug with macOS and docker is quite, let´s call it tricky ;)

The following steps need to be proceed to get it working:

  1. use the config from the xdebug.ini wihtin your docker web container. Important: set remote_connect_back to off
  2. set up an alias for your local interface (lo)

To bring up the alias at startup, you can either (sudo may be needed here):

@viezel
viezel / imagick-3.4.0-PHP7-forge.sh
Created June 22, 2016 16:18 — forked from pascalbaljet/imagick-3.4.0-PHP7-forge.sh
Install Imagick 3.4.0 on PHP 7.0 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.0.tgz
tar xvzf imagick-3.4.0.tgz
@viezel
viezel / ClearBeanstalkdQueueCommand.php
Last active August 29, 2015 14:27 — forked from lukaswhite/ClearBeanstalkdQueueCommand.php
Clear a Beanstalkd Queue in Laravel
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ClearBeanstalkdQueueCommand extends Command {
/**

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- array of downloads. -->
<key>items</key>
<array>
<dict>
<!-- an array of assets to download -->
/*! Socket.IO.js build:0.9.6, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
/**
* Originally Ported to titanium by Jordi Domenech <jordi@iamyellow.net>
* source: https://github.com/iamyellow/socket.io-client
*/
this.io = {};
module.exports = this.io;
/**
@viezel
viezel / NappUI.js
Last active December 19, 2015 16:38 — forked from raulriera/NappUIHack.js
// We need to add the following proxies to our project before Napp UI works.
// This is due to some limitations of the Titanium Module SDK
// Please run this after you require the
exports.initNappUI() {
require('dk.napp.ui'); // require the module
// window and tabs
@viezel
viezel / app.js
Created July 24, 2012 21:15 — forked from dawsontoth/app.js
Customize the look of the tab bar in iOS Appcelerator Titanium
Ti.include('overrideTabs.js');
/*
This is a typical new project -- a tab group with three tabs.
*/
var tabGroup = Ti.UI.createTabGroup();
/*
Tab 1.