This file contains 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
class Fib(dict): | |
def __init__(self): | |
self[0] = self[1] = 1 | |
def __missing__(self, k): | |
fibk = self[k] = self[k - 1] + self[k - 2] | |
return fibk | |
fib = Fib() | |
print(fib[10]) |
This file contains 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
IO.puts("Using .iex.exs file loaded from #{__DIR__}/.iex.exs") | |
defmodule Util do | |
def atom_status do | |
limit = :erlang.system_info(:atom_limit) | |
count = :erlang.system_info(:atom_count) | |
IO.puts("Currently using #{count} / #{limit} atoms") | |
end |
This file contains 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
# Save this file as example.exs in the root of a mix project with credo installed | |
# and [Credo.Check.Readability.Specs](https://hexdocs.pm/credo/Credo.Check.Readability.Specs.html) check enabled | |
# and run a | |
# ``` bash | |
# mix credo example.exs | |
# ``` | |
# command to trigger the error | |
# or | |
# get a .credo.exs file with the check enabled and | |
# uncomment the last line and run this as an escript with |
This file contains 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
JSONAPIObject: | |
description: Includes the current JSON:API version for this specification as well as optional meta information | |
type: object | |
required: | |
- version | |
properties: | |
version: | |
type: string | |
default: '1.0' | |
example: '1.0' |
This file contains 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
// ==UserScript== | |
// @include https://web.telegram.org/* | |
// ==/UserScript== | |
var url = "https://web.telegram.org/#/im?p=@bitethebot"; | |
const action_timeout = 6000; | |
const min_timeout = 60000; | |
const max_timeout = 300000; | |
const start_timeout = 5000; | |
const max_timeout_delta = max_timeout - min_timeout; |