Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Detlefsen patrickdet

View GitHub Profile
View update-prs.yml
on:
push:
branches:
- master
jobs:
update-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@0.9.0
View elm-binary-tree.elm
sum : Tree Int -> Int
sum tree =
case tree of
Empty -> 0
Node v left right ->
v + sum left + sum right
flatten : Tree a -> List a
flatten tree =
case tree of
@patrickdet
patrickdet / fooserver.ex
Created May 9, 2014
Elixir XGen GenServer semantics discussion
View fooserver.ex
defmodule FooServer do
@behaviour :gen_server
@server_name {:global, :foo_server}
# Client
def do_it do
try do
:gen_server.call @server_name, :foo
catch
View vinz_access.compile_error2
vinz_access [master] ✗ $ mix deps.get && mix test
All dependencies up to date
* Compiling poolboy
==> poolboy (compile)
* Compiling decimal
* Compiling postgrex
* Compiling ecto
Compiled lib/mix/tasks/access.ex
Compiled lib/vinz/access/repo.ex
Compiled lib/vinz/access/models/principal.ex
View vinz_access.compile_error
vinz_access [master] $ mix deps.get && mix test
All dependencies up to date
* Compiling poolboy
==> poolboy (compile)
* Compiling decimal
Compiled lib/decimal.ex
Generated decimal.app
* Compiling postgrex
Compiled lib/postgrex/binary_utils.ex
Compiled lib/postgrex/records.ex
View keybase.md

Keybase proof

I hereby claim:

  • I am patrickdet on github.
  • I am patrickdet (https://keybase.io/patrickdet) on keybase.
  • I have a public key whose fingerprint is F49A D070 DFF2 939E 9E45 70FF C1E8 6956 57A3 765C

To claim this, I am signing this object:

View user_signup.rb
class UserSignup
def initialize(params)
@params = params
@success = false
signup
end
def user
@user
end
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDW3MQ/9xTFHnicb5hcMr+dbE6w5GHm2iyLtLB87dgI9OVsz+scUymxg434IFPNVdvMiQEt4zDiTY8bPdBAKwGz7A6z2yHWcK97emvZEvJ7IqIyybqbflH4ldzn1+T0czhpeWYGNWtz2MpXFDkdEAHeHm/tkjBnXTdfbqlp6LCXB7KZ8uoWlbRw1Wsx1R6JVsb5TFV2gVGVQ0q0MD+FqOEFUtTG+LcyI1CjMwVdSzvIDUw0AZ7htlE0DMNMU1Q3jQxniyqASOf73MPpXKxXnwXY9rWH6iwsGKQ5MaHXTkVUwmC/ykkn/DAF6HRSJTUBJim5sj4xTLb1vnau9/aH00At
@patrickdet
patrickdet / Prozesse.md
Created Mar 6, 2012 — forked from salzig/Prozesse.md
Betriebssysteme
View Prozesse.md

Prozess - das laufende Programm

Programm

Erzeugung

  • unix: fork, execve
  • windows:CreateProcess

Beenden

  • unix: exit / kill
  • windows: ExitProcess / TerminateProcess
@patrickdet
patrickdet / DeviseJsonAdapter.rb
Created Jan 16, 2012 — forked from wrs/DeviseJsonAdapter.rb
JSON-encoded error and redirect results for Devise controllers
View DeviseJsonAdapter.rb
# JSON-encoded error and redirect results for Devise controllers.
# This overrides an internal method of Devise, so be careful when updating Devise!
#
# Usage:
#
# class Users::RegistrationsController < Devise::RegistrationsController
# include DeviseJsonAdapter
# end
#
# devise_for :users, :controllers => { :registrations => "users/registrations" }