Skip to content

Instantly share code, notes, and snippets.

@tomodutch
tomodutch / Dockerfile
Created June 30, 2018 04:21
Dockerfile for ubuntu-bionic with elixir
FROM ubuntu:bionic
RUN apt-get update -yqq && apt-get install wget gnupg -y
RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && dpkg -i erlang-solutions_1.0_all.deb && apt-get update -yqq
RUN apt-get install esl-erlang elixir -y
@tomodutch
tomodutch / clusterfuck.ts
Created June 10, 2018 17:19
2018-06-10 or how they fucked up the type definitions
import * as React from 'react';
import {
Field,
FieldArray,
FieldIterate,
FieldsProps,
GenericFieldArray,
WrappedFieldArrayProps,
WrappedFieldInputProps,
WrappedFieldProps
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>places</title>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=[KEY]&libraries=places"></script>
<style media="screen">
#map {
height: 100vh;
width: 100vw;
@tomodutch
tomodutch / phpunit.xml
Last active May 3, 2018 13:20
phpunit in memory sqlite database
<?xml version=”1.0" encoding=”UTF-8"?>
<phpunit>
<php>
<env name=”DB_CONNECTION” value=”sqlite” />
<env name=”DB_DATABASE” value=”:memory:” />
</php>
</phpunit>
:100000000C94E7030C942E040C942E040C942E04F0
:100010000C942E040C942E040C942E040C942E0498
:100020000C942E040C942E040C94502B0C94222C23
:100030000C94AB210C942E040C942E040C942E04DE
:100040000C942E040C942E040C942E040C942E0468
:100050000C942E040C9413220C942E040C942E0455
:100060000C942E040C942E040C942E040C942E0448
:100070000C942E040C942E040C942E040C942E0438
:100080000C942E040C942E040C942E040C942E0428
:100090000C942E040C942E040C942E040C942E0418
import {Component, OnInit} from '@angular/core';
import {PaymentService} from '../payment.service';
import {Payment} from '../payment';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/operator/switchMap';
import {Subject} from 'rxjs/Subject';
@tomodutch
tomodutch / scraper.ex
Last active May 22, 2016 18:52
Fetch content from most recent posts on reddit
defmodule Scraper do
def scrape(subreddit) do
%{body: body} = HTTPoison.get!("https://www.reddit.com/r/#{subreddit}/.rss")
{:ok, feed, ""} = FeederEx.parse(body)
fetch_content(get_links(feed))
end
defp get_links(%FeederEx.Feed{entries: entries}) do
Enum.map(entries, fn (%FeederEx.Entry{link: link}) ->
link
height 4ft (1.20m)
weight 150 pounds (68k)
hair red
age 220

Tiuri

The dwarf is born in poverty. His tribe was brutaly slaugthered by humans and he got sold as a slave. Not knowing his name, his master named him Tiuri. The master made Tiuri fight and kill for his amusement. It was only natural to become a gladiator when reaching adolescence. After his success in the arena he was recruted by the military and quickly earned the respect of his peers. The commanding officer took a liking to Tiuri for his honesty and directness. He knew how to follow orders and not ask questions. During his service he learned how to keep his subordinates in line and not take no for an answers. During one of his adventures he overheard that his brother might still be alive somewhere. He left the military to search for him. In the present,

defmodule UID.Registry do
@moduledoc """
"""
use GenServer
@doc """
Link the Registry with the current process.
"""
def start_link(opts \\ []) do