Skip to content

Instantly share code, notes, and snippets.

View codification's full-sized avatar

Ville Svärd codification

  • Stockholm, SE
View GitHub Profile
@codification
codification / FirstTest.java
Last active February 3, 2018 13:19
Trying out closures as tests in Java8/junit5
import org.junit.jupiter.api.Assertions;
public class FirstTest extends FuncTest {
{{
describe("A test", () -> {
Assertions.assertTrue(() -> true);
});
describe("Another test", () -> {
@codification
codification / DropdownBoxTest.java
Last active July 23, 2020 11:21
Selenium Test Angular Multiselect Dropdown
package tst;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.Wait;
@codification
codification / conflicting.txt
Last active May 28, 2017 22:02
(Sometimes) Conflicting aspects of TDD
So.
First there was this, from @jbrains:
https://twitter.com/jbrains/status/868129015986618368
> There is more to #tdd than just writing the test first and looking
> for mistakes in the runtime behavior of the system.
Then there was this response from @gdinwiddie:
https://twitter.com/gdinwiddie/status/868279210963587073
> Yeah, but that's a good first step toward learning TDD.
! Xft settings ---------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
! URxvt settings ---------------------------------------------------------------
!URxvt*font: xft:Anonymous Pro:pixelsize=12:antialiasing=true
@codification
codification / docker-compose-haproxy-with-logging.yml
Created February 22, 2017 22:12
Docker haproxy with http logging through syslog proxying to local port (for debugging)
version: "2"
services:
rsyslog:
image: jumanjiman/rsyslog
proxy:
image: haproxy
volumes:
- ./:/cfg
volumes_from:
- rsyslog
@codification
codification / build.boot
Last active July 12, 2017 09:47
docker-for-aws in clojure using amazonica
(set-env!
:source-paths #{"src/clj"}
:resource-paths #{"resources"}
:dependencies '[[org.clojure/clojure "1.9.0-alpha14"]
[amazonica "0.3.78"]])
@codification
codification / Dockerfile
Created March 6, 2015 16:54
docker-lab history
FROM node
EXPOSE 9615
RUN mkdir -p /src/app
COPY server.js /src/app/
WORKDIR /src/app
CMD node server.js
@codification
codification / clojure-intro.md
Last active December 16, 2015 00:39
Introduktioner till Clojure
@codification
codification / core.clj
Last active December 16, 2015 00:30
FP-meetup Token-Ring
(ns tokenring.core
(:require [lamina.core :as lamina])
(:require [aleph.tcp :as aleph])
(:require [gloss.core :as gloss]))
(defn connect-and-send [message]
(println (str "connecting and sending: " message))
(let [ch (lamina/wait-for-result
(aleph/tcp-client {:host "192.168.48.35"
;;:host "localhost"
@codification
codification / mail.clj
Created April 2, 2012 20:19
ssh key rejected on ec2 eu-west-1
(ns mail
(:use [pallet.utils :only [make-user]]
[pallet.crate.automated-admin-user :only [automated-admin-user]]
[pallet.phase :only [phase-fn]]
[pallet.core :only [server-spec group-spec converge]]
[pallet.compute :only [compute-service-from-config-file]]))
(def my-admin-user (make-user "superuser"
:public-key-path "/path/to/public"
:private-key-path "/path/to/private"))