Skip to content

Instantly share code, notes, and snippets.

@elye
elye / Kotlin Date Iterator
Last active July 15, 2021 22:10
Kotlin Date Iterator
class TestingClass {
fun testingFunction() {
for (everyday in this year 2017) {
// Do something with everyday
println(everyday.toString())
}
}
private infix fun year(year: Int): DateRange {
return Date(year, 1, 1)..Date(year, 12, 31)

Getting started with Elixir - Part 1

If you have been reading blog posts, hacker news threads, your favorite developers tweets or listening podcasts at this point I'm pretty sure you heard about Elixir programming language. The language was created by José Valim, a well known developer in the open-source world, you probably know him from the Ruby on Rails MVC framework or from the devise and simple_form ruby gems him and his co-workers from the Plataformatec have been working in the last years.

Elixir, a brief history

According the José Valim, the language was born 2011. He had the idea to build the new language due the lack of good tools to solve the concurrency problems in the ruby world. At that time, after spending time studying concurrency and distributed focused languages he found two languages that he likes Erlang and Clojure which runs in the JVM. He liked everything he saw in the Erlang language (Erlang VM) and he hated the things he didn't see, like polymorphism, metaprogramming and languag

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end