Skip to content

Instantly share code, notes, and snippets.

@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
@mikehaertl
mikehaertl / README.md
Last active September 19, 2022 21:20
How to develop with docker and Yii2

Docker Development Workflow

These ideas are WORK IN PROGRESS!

Summary

The core idea with this workflow is that we end up with a self contained docker image of your application. This image will not only contain our code, but also all the dependencies that are neccessary to run the code. This image can then be used for both, easy deployment in production and as basis for ongoing development.

The image is not a static, though. In fact, it will see many revisions over time - which is supported nicely through dockers inheritance approach. We basically

@mikehaertl
mikehaertl / vimrc.local
Last active February 18, 2021 14:44
A global vim configuration on Ubuntu that uses Vundle. Just put it in /etc/vim/vimrc.local and follow the instructions
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" /etc/vim/vimrc.local V1.1.12 2019-07-30 https://gist.github.com/mikehaertl/1612035
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" A Vundle based Vim configuration with globally shared plugins on Ubuntu.
"
" This is a Vundle based Vim setup that keeps all plugins in a global
" directory, namely /etc/vim/bundle. It's trimmed towards PHP development
" with Yii.
"
PHPUnit 5.1.3 by Sebastian Bergmann and contributors.
FFSSE.EFFF.....EFEFFFEEEEE.. 28 / 28 (100%)
Time: 37 ms, Memory: 6.00Mb
There were 9 errors:
1) yiiunit\extensions\bootstrap\ButtonDropdownTest::testContainerOptions
Array to string conversion
@mikehaertl
mikehaertl / model\User.php
Last active December 28, 2015 01:58
Reorganization of Yii2 REST HAL implementation
<?php
namespace app\models;
use Yii;
use yii\web\Link;
use yii\web\Linkable;
use yii\helpers\Url;
// Use HAL trait
use yii\rest\hal\ArrayableTrait;
@mikehaertl
mikehaertl / gist:6110758
Created July 30, 2013 06:29
Stack trace
/var/lib/gems/1.9.1/gems/stringex-2.0.5/lib/stringex/localization/backend/i18n.rb in i18n_translations_for
::I18n.translate("stringex", :locale => locale, :default => {})
/var/lib/gems/1.9.1/gems/stringex-2.0.5/lib/stringex/localization/backend/i18n.rb in block in translations
@translations ||= Hash.new { |hsh, locale| hsh[locale] = Hash.new({}).merge(i18n_translations_for(locale)) }
/var/lib/gems/1.9.1/gems/stringex-2.0.5/lib/stringex/localization/backend/i18n.rb in yield
translations[locale][scope][key.to_sym]
/var/lib/gems/1.9.1/gems/stringex-2.0.5/lib/stringex/localization/backend/i18n.rb in default
translations[locale][scope][key.to_sym]
/var/lib/gems/1.9.1/gems/stringex-2.0.5/lib/stringex/localization/backend/i18n.rb in initial_translation
translations[locale][scope][key.to_sym]
@mikehaertl
mikehaertl / gist:6094165
Created July 27, 2013 07:51
Output of gem list
actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
atomic (1.1.10)
builder (3.2.2, 3.1.4, 3.0.0)
bundler (1.3.5)
@mikehaertl
mikehaertl / gist:5387743
Created April 15, 2013 12:37
vim output of :set
:set
--- Options ---
autoindent helplang=en laststatus=2 report=0 smartcase ttymouse=xterm
background=dark hidden lazyredraw ruler smarttab updatetime=300
cindent history=50 list scroll=41 softtabstop=4 wildmenu
confirm hlsearch modified scrolloff=10 syntax=nginx t_Co=256
expandtab ignorecase mouse=a shiftwidth=4 tabstop=4
filetype=nginx incsearch pastetoggle=<F11> showmatch ttyfast
backspace=indent,eol,start
fileencoding=utf-8
<?php
/**
* writeToExcelFiles
*
* $messages is an array of this format:
* [
* 'de' => [
* 'categoryA' =>
* 'text in line 1',
* 'text in line 2',
@mikehaertl
mikehaertl / vim.md
Created August 5, 2015 12:08
Vim Tipps

Vim

Basics

Hilfe

  • :help: Hilfe aufrufen
  • :help thema: Hilfe zu Thema/Befehl aufrufen
  • <ctrl>-5: Zu verlinktem Thema springen (statt <ctrl>-])
  • -t: Zurückspringen