Skip to content

Instantly share code, notes, and snippets.

View Kintull's full-sized avatar

Roman Berdichevskii Kintull

  • The Netherlands, Alkmaar
View GitHub Profile
@Amber-Cloud
Amber-Cloud / weather.py
Created January 7, 2020 20:00
A program that gives current weather for a given city name (with ALPHA-2 country code).
import urllib
import json
def kelvin_to_celsius(temp):
'''
This function transforms temperature in Kelvins to Celsius
'''
return round(temp - 273.15)
def weather_search():
@eiri
eiri / erlang-version-check.md
Last active October 31, 2024 15:21
Quick check on erlang version from command line
$ erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'
"Erlang/OTP 20 [erts-9.1.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]\n"
@tsubery
tsubery / phoenix_session_test.md
Last active August 8, 2024 14:11
How to set session in phoenix controller tests

If you are reading this, you probably tried to write code like this

test "testing session" do
  build_conn()
  |> put_session(:user_id, 234)
  |> get("/")
  ...
  end

And got this exception: