Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am matixmatix on github.
* I am jurgenwerk (https://keybase.io/jurgenwerk) on keybase.
* I have a public key ASAl53xqOnAx-a6sQpPJQZRen8HWT5HkxeUu1JecrOa2bwo
To claim this, I am signing this object:
@jurgenwerk
jurgenwerk / boros_sammlung_availability_checker.rb
Created March 30, 2019 14:20
Ruby script to check if Boros Sammlung in Berlin has any free space on provided dates
url = "https://www.sammlung-boros.de/visit/fuehrungen-buchen.html?L=1#item_2"
date_range = Date.parse("10-05-2019")..Date.parse("13-05-2019")
html = open(url)
doc = Nokogiri::HTML(html)
doc.search(".block_empty").map do |b|
[b.parent.parent.parent.search("h1").text.split(",")[1].strip, b.parent.text.chomp.strip]
end.select { |r| Date.parse(r[0]).in?(date_range) }
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['k-content'],
style: null,
options: null,
widgetType: null,
widgetId: null,
@jurgenwerk
jurgenwerk / controllers.application.js
Created November 10, 2016 20:31
Route action bubbling examples
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Teams'
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
changeFromComponentCode() {
this.get('onChange')(true);
}
}
});
@jurgenwerk
jurgenwerk / currencies.js
Last active April 16, 2016 20:43
Simple currencies
export default {
USD: {
symbol: "$",
name: "US Dollar"
},
CAD: {
symbol: "CA$",
name: "Canadian Dollar"
},
EUR: {
@jurgenwerk
jurgenwerk / Common-Currency.json
Created March 26, 2016 10:15 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
import Ember from 'ember';
import AjaxService from 'ember-ajax/services/ajax';
export default AjaxService.extend({
session: Ember.inject.service(),
headers: Ember.computed('session', function() {
const headers = {};
this.get('session').authorize('authorizer:application', (headerName, headerValue) => {
headers[headerName] = headerValue;
});
@jurgenwerk
jurgenwerk / screenshot.rb
Created May 13, 2014 21:26
Taking Screenshots with Capybara and Webkit
require 'capybara'
require 'capybara/dsl'
Capybara.current_driver = :webkit
module Screenshot
class Test
include Capybara::DSL
def take_screenshot(url)