Skip to content

Instantly share code, notes, and snippets.

Hendrik Mans hmans

Block or report user

Report or block hmans

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hmans
hmans / application.html.slim
Created Apr 30, 2019
Rails 6.0 Application Layout using Slim
View application.html.slim
doctype html
html
head
title My Rails 6.0 App
= csrf_meta_tags
= csp_meta_tag
meta name="viewport" content="width=device-width, initial-scale=1.0"
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
@hmans
hmans / application.html.slim
Last active Dec 14, 2018
Application layout for Rails (4 and 5), Slim style.
View application.html.slim
doctype html
html
head
title My App
meta name="viewport" content="width=device-width, initial-scale=1.0"
= stylesheet_link_tag "application", media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag "application", 'data-turbolinks-track' => true
= csrf_meta_tags
body
@hmans
hmans / application.html.slim
Last active Oct 23, 2018
Rails 5.2 Application Layout using Slim
View application.html.slim
doctype html
html
head
title My Rails 5.2 App
= csrf_meta_tags
= csp_meta_tag
meta name="viewport" content="width=device-width, initial-scale=1.0"
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
@hmans
hmans / cheesecake.md
Last active Sep 4, 2018
Motherfucking Cheesecake
View cheesecake.md

MOTHERFUCKING CHEESECAKE

Zutaten:

Für den Boden:

  • 150g Vollkornbutterkekse
  • 2 EL Zucker
  • Prise Zimt
  • 60g weiche Butter
@hmans
hmans / gamedevcheatsheet.md
Last active Jun 29, 2018
Game Development Cheat Sheet
View gamedevcheatsheet.md
@hmans
hmans / app.cr
Created Apr 25, 2018
Happy + Crystal = Crappy
View app.cr
require "crappy"
class AppHandler
include HTTP::Handler
include Crappy::Routing
include Crappy::Rendering
def call(context)
crappy do
within "api" do
@hmans
hmans / elixir_phoenix_notes.md
Last active Apr 4, 2018
Notes on learning Elixir and Phoenix
View elixir_phoenix_notes.md

Notes on learning Elixir and Phoenix

Just some assorted notes I've made while digging into Phoenix, Elixir and friends. I'm coming from a strong Rails background, so many of these will refer to features from that framework.

Views / Templates

Biggest difference from Rails?

Unlike Rails, where rendering is almost always performed by a template file, the responsibility of rendering a response in Phoenix lies with a view module (that typically corresponds to the current controller module.) This view module will typically offer a whole bunch of render functions (matching different parameters, first and foremost the template name.) Templates (found in web/templates/) will directly compile into such functions.

@hmans
hmans / application.html.slim
Created Dec 3, 2017
Rails 5.2 Slim Application Layout
View application.html.slim
doctype html
html
head
title My Rails 5.2 App
meta name="viewport" content="width=device-width, initial-scale=1.0"
= csrf_meta_tags
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
body
@hmans
hmans / application.html.slim
Created Nov 8, 2016
Rails 5.0 Application Layout, Slim-style
View application.html.slim
doctype html
html
head
title My App
meta name="viewport" content="width=device-width, initial-scale=1.0"
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
= csrf_meta_tags
body
@hmans
hmans / Clicker.elm
Last active Jan 17, 2018
Very simple (and unfinished) incremental clicker game written in Elm.
View Clicker.elm
module Clicker exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import Time exposing (Time, second)
-- MODEL
You can’t perform that action at this time.