Skip to content

Instantly share code, notes, and snippets.

🥇
🏅

Tomek Wałkuski tomekw

🥇
🏅
Block or report user

Report or block tomekw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gradlew test failed
$ ./gradlew test
> Task :test FAILED
com._98elements.CalculatorSpec > adds 2 to 2 FAILED
org.opentest4j.AssertionFailedError at CalculatorSpec.kt:11
3 tests completed, 1 failed
FAILURE: Build failed with an exception.
View gradlew test
$ ./gradlew test
BUILD SUCCESSFUL in 2s
3 actionable tasks: 2 executed, 1 up-to-date
View build.gradle
// build.gradle
buildscript {
// use specific Kotlin version
ext.kotlin_version = '1.2.61'
}
plugins {
// install Kotlin JVM gradle plugin
id 'org.jetbrains.kotlin.jvm' version '1.2.61'
View settings.gradle
// settings.gradle
rootProject.name = 'calculator'
View Calculator.kt
// file: src/main/kotlin/com/_98elements/Calculator.kt
package com._98elements
object Calculator {
fun add(a: Int, b: Int) = a + b
fun divide(a: Int, b: Int) = a / b
}
View CalculatorSpec.kt
// file: src/test/kotlin/com/_98elements/CalculatorSpec.kt
package com._98elements
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.assertThrows
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
object CalculatorSpec: Spek({
@tomekw
tomekw / test_channel_spec.rb
Last active Jun 6, 2019
Unit testing ActionCable channels with RSpec
View test_channel_spec.rb
# app/channels/hello_channel.rb
class HelloChannel < ActionCable::Channel::Base
def say_hello(data)
times_to_say_hello = data.fetch("times_to_say_hello")
hello = "Hello, #{current_profile.name}!"
times_to_say_hello.times do
ActionCable.server.broadcast(current_profile.id, hello)
end
end
View keybase.md

Keybase proof

I hereby claim:

  • I am tomekw on github.
  • I am tomekw (https://keybase.io/tomekw) on keybase.
  • I have a public key whose fingerprint is E3DF 760E C16C 936E B949 11C2 081B 19A1 2D4C 4A8E

To claim this, I am signing this object:

@tomekw
tomekw / bubblebabble_ruby
Created Sep 21, 2016
Whiskey Tango Foxtrot
View bubblebabble_ruby
> require "digest/bubblebabble"
=> true
> Digest::SHA256.bubblebabble("_tomekw")
=> "xihag-nivyk-lucah-zekek-segyg-dimib-zeken-mepov-cilet-cegah-coteg-vipit-mybyg-cehor-kerec-gylyf-vaxux"
@tomekw
tomekw / the-programming-language-i-want.md
Created Sep 12, 2016
The programming language I want
View the-programming-language-i-want.md
  • statically-typed
  • strongly-typed
  • only one way to do one thing
  • no "syntax shortcuts" (cryptic operators, etc.)
  • immutability (value "classes", collections)
  • pattern matching
  • higher-order functions
  • readable syntax (lisp-case a.k.a. kebab-case indentifiers, do...end, def, etc.)
  • no need for an IDE
  • native binaries (optionally statically-linked)
You can’t perform that action at this time.