| № | Приём | Определение | Пример |
|---|---|---|---|
| 1 | Ярлык вместо аргумента — Name-calling / Labeling | Оппоненту приклеивают оскорбительный ярлык вместо разбора его доводов | На подробный разбор, почему новый стадион не окупится: «Ну ты зануда и неудачник, с тобой всё понятно» |
| 2 | Переход на личности — Ad hominem | Спорят не с аргументом, а с личностью того, кто его высказал | «Ты критикуешь мой ремонт? Да у тебя самого дома вечный бардак» |
| 3 | Пересланный пост вместо аргумента — Appeal to anonymous authority | Чужое мнение неизвестного автора выдают за экспертное и подают как довод | «В одном телеграм-канале писали, что кофе сокращает жизнь на десять лет. Люди же разбираются» |
| 4 | Уход от дискуссии — Stonewalling | Демонстративно выходят из спора, чтобы не отвечать по существу | Друг показывает, что в отпуске на поезде выйдет дешевле, чем на машине, а в ответ: «Мне это неинтересно, я дальше не читаю» |
| 5 | Поспешное обобщение — *Has |
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
| test "ets match, select, and select_delete" do | |
| ets_table_name = :bar | |
| :ets.new(ets_table_name, [:named_table, :set, :private]) | |
| expires_at1 = ~U[2021-01-07 15:00:00.000000Z] | |
| # ~U is just a syntax sugar for struct DateTime | |
| IO.inspect(~U[2021-01-07 15:00:00.000000Z], structs: false) | |
| # I would convert DateTime to unix seconds and put it as a separate field to the ets record |
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
| case Connection.open(amqp_url) do | |
| {:error, reason} -> # pattern matching | |
| Logger.error(["Cannot establish connection to RabbitMQ, reason:", inspect(reason)]) | |
| {:error, reason} | |
| {:ok, connection} -> # pattern matching | |
| {:ok, channel} = Channel.open(connection) # pattern matching | |
| Exchange.declare(channel, @exchange, :fanout) |
I hereby claim:
- I am leikind on github.
- I am leikind (https://keybase.io/leikind) on keybase.
- I have a public key ASDfZ5OGmfASmpWp5FyIxWP0wwPHAP3YNEp0D4Xn6SQ54go
To claim this, I am signing this object:
If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8
To use the new phx.new project generator, you can install the archive with the following command:
$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:
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
| require 'set' | |
| module Shapes | |
| class Coordinate < Struct.new(:x, :y) | |
| def inspect; "#{x}:#{y}"; end | |
| end | |
| class Line < Struct.new(:p1, :p2) | |
| def inspect |
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 Efrontback.AuthExamples do | |
| alias Efrontback.Device | |
| alias Efrontback.User | |
| alias Efrontback.Repo | |
| use Efrontback.Web, :model | |
| def no_schema() do | |
| real_device_token = "abcdefg" |
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
| # kinda library code | |
| def pack(v) | |
| [v] | |
| end | |
| class Array | |
| def unpack | |
| self[0] | |
| end |
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 string_to_number(str) | |
| Integer('0b' + str.unpack('B*')[0]) | |
| end | |
| def number_to_utf8_string(num) | |
| str = [num.to_s(2)].pack('B*') | |
| str.force_encoding(Encoding::UTF_8) | |
| end | |
| p string_to_number("мудак") |
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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/nfnt/resize" | |
| "image/jpeg" | |
| "io" | |
| "os" | |
| ) |
NewerOlder