Skip to content

Instantly share code, notes, and snippets.

View peyerluk's full-sized avatar

Lukas Peyer peyerluk

View GitHub Profile
@peyerluk
peyerluk / speechkit_api.md
Created November 13, 2020 15:49
Berliner Zeitung Speechkit API
POST /blz/v1/speechkit/audio

Payload:

id: 'number',
external_id: 'string',
state: 'string', // 'processed' or 'unprocessed'
deleted: 'boolean',
module.exports = {
type: 'labelValuePair',
items: [
'Aktuell',
'Bauen',
'Bildung',
'Gesund',
'Kalender',
'Leben',
'Mobil',
@peyerluk
peyerluk / .scss-lint.yml
Last active August 29, 2015 14:20
Livingdocs scss-lint example
# Default application configuration that all configurations inherit from.
scss_files: "**/*.scss"
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
@peyerluk
peyerluk / gist:6b74ca6c1764af356165
Created June 23, 2014 09:11
SwipeEvents (jQuery plugin)
# Credit: Eike Send for the awesome swipe event
# ---------------------------------------------
#
# https://github.com/peachananr/onepage-scroll
$.fn.swipeEvents = ->
return this.each ->
startX = startY = undefined
$this = $(this)
$this.bind('touchstart', touchstart)
@peyerluk
peyerluk / ScrollCapture
Created June 23, 2014 08:48
Spike for scroll capturing
#= require _swipe_event
settings =
sectionContainer: "section",
easing: "ease",
animationTime: 1000,
pagination: true,
updateURL: false,
keyboard: true,
beforeMove: null,
module.exports = class Router
constructor: ->
@routes = []
get: (path) -> @findRoute('get', path)
post: (path, data) -> @findRoute('post', path, data)
put: (path, data) -> @findRoute('put', path, data)
patch: (path, data) -> @findRoute('patch', path, data)
@peyerluk
peyerluk / example
Last active September 20, 2020 14:05
Format swiss phone number
# validating samples:
# 783268674
# 0783268674
# 0410783268674
# 00410783268674
# +410783268674
# 041783268674
# 0041783268674
# +41783268674
# ++41783268674
dropAndRecreateTable = (name, setupMethod) ->
knex.schema.dropTableIfExists(name).then ->
knex.schema.createTable(name, setupMethod)
createDocumentPublicationsTable = (done) ->
command = dropAndRecreateTable 'document_publications', (t) ->
t.increments('id').primary()
t.integer('document_id').notNullable()
t.integer('revision_id').notNullable()
t.unique [
'document_id'
'publication_number'
], 'index_document_publications_on_document_id_and_publication_nr'