Skip to content

Instantly share code, notes, and snippets.

View jansabbe's full-sized avatar

jansabbe

View GitHub Profile
@jansabbe
jansabbe / index.html
Created May 29, 2011 11:45
CSS3 buttons that work on IE8 using PIE.js
<!DOCTYPE HTML>
<html>
<head>
<title>Css button preview</title>
<meta http-equiv="X-UA-Compatible" content="IE=100" >
<!--[if lt IE 10]>
<script type="text/javascript" src="PIE.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">
@jansabbe
jansabbe / gist:1002387
Created June 1, 2011 14:27
Creating linecharts with gRaphael
var linechart = Raphael(document.getElementById('holder')).
g.linechart(10,10,400,400,[1,2,3,4,5,6],[[5,4,3,2,1,0],[5,3,4.3,3,2,0]], {
shade:true,
smooth:true,
axisxstep:5,
axis:"0 0 1 1"
});
linechart.axis[0].text.items[3].attr('text','kjfd');
@jansabbe
jansabbe / gist:1009277
Created June 5, 2011 19:00
Example calling json webservice with jQuery
var jsonData = JSON.stringify({
stad: 'Leuven',
soort: 'KLEI',
telefoonNummer: '141414'
});
$.ajax('/plaatsen', {
success:function (data) {console.log(data)},
type: 'PUT',
dataType: 'json',
@jansabbe
jansabbe / gist:1011907
Created June 7, 2011 08:34
Get value of a parameter from a url in javascript
function getParameterByName(parameter, url) {
var parameterValue = RegExp("[?&]" + parameter + "=([^&]*)").exec(url);
return decodeURIComponent(parameterValue[1].replace(/\+/g, " "));
}
@jansabbe
jansabbe / gist:1014701
Created June 8, 2011 15:55
sencha touch map with marker
new Ext.Map({
useCurrentLocation: true,
listeners: {
maprender : function(comp, map){
var marker = new google.maps.Marker({
position: map.center,
title : 'testing',
map: map
});
}
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route("/api/users")
def users():
return jsonify(users = [
{
"firstname":"Joske",
"lastname": "Vermeulen"
let handler = {
get(target,name) {
return `Hello ${name}`
}
}
let obj = new Proxy({},handler);
obj.world // Hello world
@jansabbe
jansabbe / gist:1f2acaebb353cd82b87b
Created July 10, 2015 09:07
Test builders in JavaScript using lodash
function createTestPerson(override) {
var defaultPerson = {
id: 1,
firstname: 'Bert',
lastname: 'Macklin'
}
return _.merge(defaultPerson, override);
}
var person1 = createTestPerson(),
@jansabbe
jansabbe / GoogleTests.cs
Created May 18, 2017 12:20
Basic webdriver example with page objects
using System.Collections.Generic;
using System.Linq;
using HtmlElements;
using HtmlElements.Elements;
using HtmlElements.Extensions;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.PageObjects;
@jansabbe
jansabbe / GenericBuilder.cs
Last active June 29, 2020 05:50
Generic With method builder
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Xunit;
namespace Tjoelala
{
public class Person