Skip to content

Instantly share code, notes, and snippets.

View basti1302's full-sized avatar

Bastian Krol basti1302

View GitHub Profile
@basti1302
basti1302 / keybase.md
Created July 24, 2018 05:20
Verifying myself

Keybase proof

I hereby claim:

  • I am basti1302 on github.
  • I am basti1302 (https://keybase.io/basti1302) on keybase.
  • I have a public key ASBijUw927CXoPXFpcWt9FmaJAA-gHurdMeZf9l23Bj2eAo

To claim this, I am signing this object:

@basti1302
basti1302 / 01 readme.markdown
Last active December 10, 2017 22:56
Custom combinator which accesses the Auth Context
@basti1302
basti1302 / Util.Migration.hs
Created October 27, 2016 09:25
Use jtdaugherty/dbmigrations to upgrade the DB at app startup
{-# LANGUAGE ScopedTypeVariables #-}
module Util.Migration (upgradeDatabase) where
import qualified Util.Config as Config
import Control.Monad (forM_)
import Database.Schema.Migrations
import Database.Schema.Migrations.Backend
import Database.Schema.Migrations.Filesystem (FilesystemStoreSettings (..),
Test suite dbmigrations-tests: RUNNING...
### Failure in: 1:MySQL backend tests
test/BackendTest.hs:120
Installed migrations
expected: ["root"]
but got: ["root","second"]
Cases: 80 Tried: 80 Errors: 0 Failures: 1
Migration created successfully: "first"
Migration created successfully: "first"
Migration created successfully: "second"
@basti1302
basti1302 / Main.elm
Last active October 23, 2015 23:49
Runtime error in Elm due to shadowing
import Html
type alias Model = { a : String }
one = { a = "1" }
two = { a = "2" }
getNext : Model -> Model
getNext current =
let
@basti1302
basti1302 / random-signal.elm
Created August 19, 2015 06:23
Creating a steady timed signal from random and feeding it into HTML output
import Html exposing (..)
import Random
import Random exposing (Seed)
import Signal exposing (Signal, (<~), (~))
import Time exposing (every, second)
randomFloat : Seed -> Float
randomFloat seed = seed |> (Random.generate <| Random.float 0 1) |> fst
randomBool : Seed -> Bool

Go Lab

Just some random things one could try to get acquainted with Go... only to be used if you lack the creativity to come up with your own ideas ;-)

Set up your environment

  1. Install Go
  2. Maybe configure your preferred text editor for Go
@basti1302
basti1302 / pyramid.js
Created October 26, 2013 08:07
Compare the consumption of a Hypermedia API with and without Traverson
'use strict';
var request = require('request')
var traverson = require('./traverson')
var rootUri = 'https://api.github.com/'
// optional: raises the rate limit of the GitHub API from 60 requests to 5000 requests per hour
var ghUser = 'basti1302',
ghPass = '...'
@basti1302
basti1302 / optional.feature
Created August 22, 2013 11:15
Use an optional parameter in Cucumber
Feature: Optional parameter
Scenario: Use an optional parameter
When I execute a step
When I execute a step with the optional parameter whatever
@basti1302
basti1302 / install_ruby_cucumber_phantomjs_windows.markdown
Last active December 20, 2015 01:29
install_ruby_cucumber_phantomjs_debian.markdown