Skip to content

Instantly share code, notes, and snippets.

View mauricerenck's full-sized avatar

Maurice Renck mauricerenck

View GitHub Profile
@mauricerenck
mauricerenck / dnsmasq.md
Last active February 20, 2019 12:19
make .test domains available without /etc/hosts

setting up .test TLD for local development

  1. Install dnsmasq: brew install dnsmasq
  2. cd $(brew --prefix); mkdir etc; echo 'address=/.test/127.0.0.1' > etc/dnsmasq.conf
  3. sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
  4. sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
  5. sudo mkdir /etc/resolver
  6. sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/test'
@mauricerenck
mauricerenck / style.css
Created February 9, 2019 13:50 — forked from traumverloren/style.css
VSCode Customizations for Operator Mono, Fira Code, and Dark Candy Theme
/*
Instructions for MacOS:
- Install the fonts 'Operator Mono' & 'Fira Code'
- Install theme 'Dark Candy'
- Add the following config to the VS Code settings.json:
{
"editor.renderWhitespace": "all",
"editor.fontSize": 14,
@mauricerenck
mauricerenck / keybase.md
Last active December 2, 2018 16:06
keybase.md

Keybase proof

I hereby claim:

  • I am mauricerenck on github.
  • I am mauricerenck (https://keybase.io/mauricerenck) on keybase.
  • I have a public key whose fingerprint is AD05 6F75 6CD7 4C99 B859 D232 C015 8BDF 436F CEF7

To claim this, I am signing this object:

@mauricerenck
mauricerenck / Response.php
Created July 4, 2018 10:38 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@mauricerenck
mauricerenck / Update remote repo
Created February 14, 2018 09:13 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@mauricerenck
mauricerenck / sw_image_path.php
Last active November 13, 2017 15:16
[Shopware] Get Image Path
<?php
$path = ltrim($path, "/");
$path_elements = explode("/", $path);
$path_info = pathinfo($path);
$path_md5 = md5($path);
$path = array_slice(str_split($path_md5, 2), 0, 3);
$path = $path_elements[0]."/".$path_elements[1]."/".join("/", $path)."/".$path_info['basename'];
$path = '//'.$_SERVER['HTTP_HOST'].'/'.$path;
@mauricerenck
mauricerenck / Ubuntu-Compass-ruby[16.04]
Created July 13, 2017 15:53 — forked from AungMyoKyaw/Ubuntu-Compass-ruby[16.04]
Compass installation for ubuntu 16.04
[https://gist.github.com/stephou0104/233b5c99884f1d8c8b8b#file-ubuntu-compass-ruby]
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
@mauricerenck
mauricerenck / filterbystructure.php
Created June 15, 2017 12:25 — forked from texnixe/filterbystructure.php
Kirby custom pages method to filter by values in structure field
<?php
/* Usage example:
* $filteredPages = $page('projects')->children()->visible()->filterByStructure('structureField', array(
* 'field1' => $value,
* 'field2' => $value
* ));
*/
pages::$methods['filterByStructure'] = function($pages, $field, $options) {
$filteredPages = $pages->filter(function($p)use($field, $options) {
$structureField = $p->$field()->yaml();
define('FS_METHOD','direct');
@mauricerenck
mauricerenck / [html] html-template
Last active January 23, 2017 11:16
[html] html5 template
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1">
<title></title>
<link href="assets/css/style.css" rel="stylesheet" media="screen">
</head>
<body>