Skip to content

Instantly share code, notes, and snippets.

public function __construct(WestcottInterface $api){
//Before filters
$this->beforeFilter('check_roles', array('except' => array('getLogin','postLogin','getLogout')));
$this->beforeFilter('csrf', array('on' => 'post'));
{
"chat": {
// the list of chats may not be listed (no .read permissions here)
// a chat conversation
"$key": {
// if the chat hasn't been created yet, we allow read so there is a way
// to check this and create it; if it already exists, then authenticated
// user (specified by auth.id) must be in $key/users
@hmaurer
hmaurer / tmux-cheatsheet.markdown
Created September 30, 2015 22:11 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
-- Informatics 1 - Functional Programming
-- Lab Week Exercise
--
-- Week 2 - due: Friday, Oct 2nd, 5pm
--
-- Insert your name and matriculation number here:
-- Name:
-- Nr. :
@hmaurer
hmaurer / 32.asm
Created December 27, 2015 23:15 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@hmaurer
hmaurer / README.markdown
Created December 30, 2015 11:42 — forked from terlar/README.markdown
ArchLinux on Mac Book Retina 13"

(my response to https://twitter.com/apotonick/status/717105889845624832)

I haven't yet came across readily available resources for large-scale application architecture for Elixir apps. I found Programming Phoenix to be a good start for that though. And there's ~30 years of knowledge in the Erlang land :)

For web apps, I found the abstractions that Elixir/Phoenix provides to be really helpful. Indeed, the list below is somewhat ORM focused.

In the small, Ecto.Schema, Ecto.Query, Ecto.Changeset, and Phoenix.View allow me to build highly composable and side-effect free modules. I can have many schemas, changesets and queries all interacting with the same underlying DB table(s) if I want to. Most of the side-effects (through Ecto.Repo for DBs) are usually in the Phoenix.Controller (or other Plugs).

@hmaurer
hmaurer / better-nodejs-require-paths.md
Created March 24, 2017 10:51 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Types where
import Prelude hiding (repeat, (/))
import Control.Applicative
import Data.Functor.Identity
import Control.Monad
{-# LANGUAGE NoMonomorphismRestriction #-}
module Match (
FormulaWithSlots(..), (/),
Matching,
match, matchTerm,
emptyMatching, extendMatch,
transform, transformTerm,
twoWayMatchExists,
isIsomorphic,