Skip to content

Instantly share code, notes, and snippets.

View basti1302's full-sized avatar

Bastian Krol basti1302

View GitHub Profile
@basti1302
basti1302 / change_keyboard_us_to_de.txt
Last active December 11, 2015 05:18
What you need to type to change the keyboard layout from "us" to "de" on CentOS, Fedora and similar Linux systems, when the actual keyboard has a German layout. There are quite a number of pages out there explaining what you need to *do*, but it's quite annoying to find the right keys to *type* while OS's keyboard layout does not match the actua…
# Lines beginning with # are not to be typed :-)
# Type this:
vi -etc-szsconfig-kezboard # vi /etc/sysconfig/keyboard
# The file probably looks like this:
KEYBOARDTYPE="pc"
KEYTABLE="us"
# Now type this:
@basti1302
basti1302 / parameterizable.spec.coffee
Last active March 1, 2018 13:17
An example of a parameterized test suite using the Jasmine BDD framework for JavaScript. This example is in CoffeeScript.
describe "The suit", ->
beforeEach ->
console.log('non-parameterized#beforeEach')
afterEach ->
console.log('non-parameterized#afterEach')
it "should execute specs in the non-parameterized part", ->
console.log('spec in non-parameterized')
@basti1302
basti1302 / install_ruby_cucumber_phantomjs_windows.markdown
Last active December 20, 2015 01:29
install_ruby_cucumber_phantomjs_debian.markdown
@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 / 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 = '...'

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 / 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
@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
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"