This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@spec as_ast(%{ | |
body: binary, | |
declaration: bitstring, | |
documentation: bitstring, | |
elixir_module: %{documentation: bitstring, slug: bitstring}, | |
elixir_typespec: %{inputs: bitstring, return: bitstring}, | |
guards: binary, | |
inputs: bitstring, | |
name: bitstring, | |
slug: integer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unit Stat Fixes: Corrects the skills of many units along with gear | |
https://www.nexusmods.com/mountandblade2bannerlord/mods/73 | |
Fast Dialogue: When fighting looters or talking to lords, you'll be hit with the simpel dialog window BEFORE loading into the first person screen | |
https://www.nexusmods.com/mountandblade2bannerlord/mods/68 | |
BannerPeasants: 1 in 10 soldiers will be carrying a big ass banner on their back | |
https://www.nexusmods.com/mountandblade2bannerlord/mods/418?tab=files&file_id=2113&nmm=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "json" | |
host = ARGV[0] | |
service = ARGV[1] || ARGV[0] | |
nodes = JSON.parse(`bin/terraform-nodes | jq '[.[] | [.hostname, .ip]]'`) | |
groups = nodes. | |
# [['a-b-c-d-e', '1.1.1.1']] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Poutineer.Models.Account do | |
# ... | |
import Estate, only: [machine: 1] | |
# ... | |
machine([ | |
onboarding_state: [complete: [converted: "completed"]], | |
role_state: [ | |
grant_moderation_powers: [user: "moderator"], | |
grant_administrator_powers: [user: "administrator", moderator: "administrator"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Amodel do | |
use Ecto.Schema | |
import Estate, only: [machine: 1] | |
machine([ | |
onboarding_state: [ | |
complete: [converted: "completed"] | |
], | |
role_state: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Estate do | |
defmacro machine(column_name, events) do | |
Enum.each(events, fn ({event_name, transitions}) -> | |
quote do | |
Enum.each(unquote(transitions), fn ({from, to}) -> | |
def unquote(:"before_#{event_name}")(%{unquote(column_name) => from} = record) do | |
record | |
end | |
def unquote(:"after_#{event_name}")(%{unquote(column_name) => to} = record) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create(_parent, arguments, _resolution) do | |
%{name: name, subject_id: subject_id} = arguments | |
tag = Repo.insert(Tag.changeset(%Tag{}, %{name: name})) | |
|> case do | |
{:ok, tag} -> tag | |
{:error, _} -> Repo.one(from(tag in Tag, where: tag.name == ^name)) | |
end | |
subject_model = case arguments do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:error, | |
#Ecto.Changeset< | |
action: :update, | |
changes: %{}, | |
errors: [tags: {"is invalid", [type: {:array, :map}]}], | |
data: #Poutineer.Models.Recipe<>, | |
valid?: false | |
>} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post | |
|> Repo.preload(:tags) | |
|> Ecto.Changeset.change() | |
|> Ecto.Changeset.put_assoc(:tags, [tag | post.tags]) | |
|> Repo.update() |