Skip to content

Instantly share code, notes, and snippets.

View sadraskol's full-sized avatar

Thomas Bracher sadraskol

View GitHub Profile
@sadraskol
sadraskol / dl_latest_chromedriver.sh
Last active August 29, 2015 14:05
download and install chromedriver in a bin directory
#! /bin/bash
echo "## dev installation ##"
echo "installling webdriver"
LATEST_RELEASE=`curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE`
VERSION=`uname -p`
if [ "$VERSION" = "x86_64" ]; then
<?php
class UserTest extends \AbstractTest
{
public function testAddTrainMapToUser()
{
// Some setup code and operations
foreach ($result as $res) {
Logger::getInstance()->info($res->getStationId() . ',' . $res->getLineId());
}
services:
mailer:
class: Mailer
newsletter_manager:
class: NewsletterManager
dependencies:
mailer: Mailer
@sadraskol
sadraskol / curl-result
Last active October 6, 2015 08:48
working jsp deployment
$ curl -i http://localhost:8181/surv-karaf/monitor.jsp
HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=yxgfs4wdknxxneykgeksvz6f;Path=/surv-karaf
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 854
Server: Jetty(8.1.17.v20150415)
$ curl -i http://localhost:8181/surv-karaf/monitor.jsp
HTTP/1.1 500 Server Error
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 5191
Server: Jetty(8.1.17.v20150415)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
defmodule DrunkMan do
def bottle(0), do: "no more bottles"
def bottle(1), do: "1 bottle"
def bottle(n), do: to_string(n) <>" bottles"
def verse(0), do: "No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall."
def verse(n), do: "#{DrunkMan.bottle n} of beer on the wall, #{DrunkMan.bottle n} of beer.
Take one down and pass it around, #{DrunkMan.bottle(n - 1)} of beer on the wall.\n"
<bookable yoid="56167d3de4b09d3daa624cea" class="medium-insert-bookable medium-insert-bookable-wide" data-href="/stories/emily-crook/most-epic-destinations-for-crazy-spring-break-in-2016/5705/activities/ACT3013">
<figure data-click="/stories/emily-crook/most-epic-destinations-for-crazy-spring-break-in-2016/5705/activities/ACT3013" data-mp-event="Clicked Book Now" data-mp-type="BookableActivity" data-mp-url="/stories/emily-crook/most-epic-destinations-for-crazy-spring-break-in-2016/5705/activities/ACT3013" gtm-action="Navigate to Activity Page" gtm-category="Story Page" gtm-click="" gtm-label="Clicked Hotel Image from Story">
<img src="https://yonderbound.imgix.net/uploads/bookable_activity/pictures/95ce22f3-a116-4b10-9d12-465a1c4d4d19/img_1444314429422.jpg?ixlib=rails-1.1.0&amp;w=600&amp;h=380&amp;fit=crop&amp;crop=entropy&amp;fm=pjpg&amp;s=35e41823eb8fca3f60df9bd7a6f81891">
</figure>
<div class="bookable-info">
<div data-click="/stories/emily-crook/most-epic-destinations-for-crazy-spring-break-
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
@sadraskol
sadraskol / gilded-rose.als
Created June 4, 2020 12:39
Naive approach to gilded-rose with alloy
open util/ordering [Time]
sig Time {}
abstract sig Item {
quality: Int one -> Time,
sellIn: Int one -> Time
}
sig AgedBrie extends Item {}
sig BackstagePass extends Item {}
@sadraskol
sadraskol / gilded-rose.als
Last active June 4, 2020 13:16
Gilded rose with higher level specification
open util/ordering [Time]
sig Time {}
abstract sig Item {
sellIn: Int one -> Time,
quality: Quality one -> Time
}
one sig AgedBrie extends Item {}
one sig BackstagePass extends Item {}