Skip to content

Instantly share code, notes, and snippets.

View foeken's full-sized avatar

Andre Foeken foeken

  • Nedap
  • Groenlo, The Netherlands
View GitHub Profile
@foeken
foeken / simple_mock.rb
Created September 3, 2008 06:56
Simple Net::Http Mock
class Net::HTTP < Net::Protocol
def connect
end
end
class Net::HTTPResponse
def body=(content)
@body = content
@read = true
end
Feature: Accessing the people api
As an API client
In order to do things with people
I want to access the people api
Background:
Given a client application named "Ons Medewerkersportaal"
And "Ons Medewerkersportaal" is allowed to use xAuth
And an account "Andre" with email "andre.foeken@nedap.com"
And an account "Ria" with email "ria.foeken@nedap.com"
@foeken
foeken / bodyparts.rb
Created January 9, 2011 17:48
Code for Caren's auto responder and signature cutoff rules. Based on BodyParts
require 'mail'
require 'tmail'
class BodyParts
def self.rules
[
# Dutch signatures
{ :server => 'Signature #1', :reply_delimiter => /^\r\nMet vriendelijke groet./m },
{ :server => 'Signature #2', :reply_delimiter => /^\r\nGroet./m },
{ :server => 'Signature #3', :reply_delimiter => /^\r\nmvg./m },
Raphael.fn.drawGrid = function (x, y, w, h, wv, hv, color) {
color = color || "#000";
var path = ["M", Math.round(x) + .5, Math.round(y) + .5, "L", Math.round(x + w) + .5, Math.round(y) + .5, Math.round(x + w) + .5, Math.round(y + h) + .5, Math.round(x) + .5, Math.round(y + h) + .5, Math.round(x) + .5, Math.round(y) + .5],
rowHeight = h / hv,
columnWidth = w / wv;
for (var i = 1; i < hv; i++) {
//path = path.concat(["M", Math.round(x) + .5, Math.round(y + i * rowHeight) + .5, "H", Math.round(x + w) + .5]);
}
for (i = 1; i < wv; i++) {
//path = path.concat(["M", Math.round(x + i * columnWidth) + .5, Math.round(y) + .5, "V", Math.round(y + h)]);
@foeken
foeken / gist:2875479
Created June 5, 2012 14:54
Falen Byte.nl
Beste,
Jammergenoeg is de wet van Dam in 2011 in werking getreden die consumenten beschermt hiertegen. Bij een opzegging van een dienst is een maandelijkse opzegtermijn verplicht. Bij opzeggen dient het openstaande gefactureerde bedrag terug te worden betaald. Aangezien het hier gaat over een stilzwijgende verlenging na 2011 is de wet van toepassing. Er is zelfs jurisprudentie over hosting bedrijven en domeinaanvragen.
Dus nogmaals vraag ik u te voldoen aan de wet en de openstaande factuur te crediteren.
http://www.opzeggen.nl/wet-van-dam
BRON: http://ictrecht.nl/contracten-en-algemene-voorwaarden/veelgestelde-vragen-over-de-wet-van-dam/
##Geldt de Wet Van Dam ook voor hosting en domeinnamen?
@foeken
foeken / gist:3739301
Created September 17, 2012 19:35
Javascript tests :)
Feature: Adaptive layout functionality
As a registered user
In order to productive on a range of devices
I want Caren Pro to fluidly scale the amount of information displayed
Background:
Given a care provider "Care4All"
And a "Care4All" employee "Andre"
And "Andre" has an activated account
And "Andre" is logged in
@foeken
foeken / gist:4160705
Created November 28, 2012 11:54
RubyMotion Bug in Module ordering
# Take the following setup, this works if everything is inside a single file.
# app/foo/monkey.rb
module Foo
module Monkey
puts "Monkey"
end
end
# app/foo/nut.rb
@foeken
foeken / keybase.md
Created March 15, 2014 11:07
Keybase Proof

Keybase proof

I hereby claim:

  • I am foeken on github.
  • I am dreetje (https://keybase.io/dreetje) on keybase.
  • I have a public key whose fingerprint is 7DC5 D6AA 64D6 6CF1 FF9E 0686 65BB 0DBC E7CE 60FE

To claim this, I am signing this object:

@foeken
foeken / gist:d4b4e207fda19abb9614
Created July 11, 2014 21:58
Get ING back to sanity
// Hack the 1password extention on OSX:
// Locate: /Users/[USERNAME]/Library/Application Support/Google/Chrome/Default/Extensions/aomjjhallfgjeglblehebfpbcfeobpgk
// Add this to global.min.js, look for var Ka = [{template},{template},{template}]
{
template_for: [/:\/\/mijn\.ing\.nl\//],
hints: [
["input[type=text]", "username"],
["input[type=password]", "password"]
@foeken
foeken / gist:018bbb5c1e482a9cf95b
Created September 30, 2014 16:38
A crude Github - Zendesk syncer
class Zendesk
ENDPOINT = "https://[DOMAIN].zendesk.com/api/v2"
USER = "[YOUR_USER_NAME]"
USER_ID = 0 #[YOUR_USER_ID]
TARGET_VIEW = 0 #[VIEW_ID]
BODY_FIELD_ID = 0 # [CUSTOM_BODY_FIELD_ID], We use an internal body
REPO_NAME_FIELD_ID = 0 #[REPO_NAME_FIELD_ID], We use a selectbox
GITHUB_FIELD_ID = 0 #[GITHUB_FIELD_ID], We use a checkbox