Skip to content

Instantly share code, notes, and snippets.

@kaspereden
kaspereden / geoFinder.js
Last active July 29, 2022 05:28
Store geolocation in cookie
/*
In order to store the object we 'flatten' the object. This has strange results in the latest version of Safari (8)
*/
navigator.geolocation.getCurrentPosition(function (geolocation) {
// in order to store the location in a cookie we 'flatten' the object to json
var cookieValue = JSON.stringify(geolocation);
});
@kaspereden
kaspereden / dabblet.css
Created July 20, 2015 10:45 — forked from anonymous/dabblet.css
Center the demo
div {
width: 280px;
height: 280px;
background: #1e90ff;
-webkit-clip-path: polygon(100% 51%, 96% 40%, 89% 29%, 80% 21%, 69% 13%, 57% 6%, 45% 3%, 30% 9%, 19% 14%, 8% 24%, 2% 34%, 0% 49%, 0% 62%, 4% 73%, 13% 84%, 24% 91%, 33% 97%, 44% 99%, 46% 89%, 55% 87%, 65% 86%, 76% 82%, 84% 75%, 92% 67%, 98% 58%);
clip-path: polygon(100% 51%, 96% 40%, 89% 29%, 80% 21%, 69% 13%, 57% 6%, 45% 3%, 30% 9%, 19% 14%, 8% 24%, 2% 34%, 0% 49%, 0% 62%, 4% 73%, 13% 84%, 24% 91%, 33% 97%, 44% 99%, 46% 89%, 55% 87%, 65% 86%, 76% 82%, 84% 75%, 92% 67%, 98% 58%);}
/* Center the demo */
html, body {
height: 100%;
}
@kaspereden
kaspereden / dabblet.css
Created July 20, 2015 10:45
Center the demo
div {
width: 280px;
height: 280px;
background: #1e90ff;
-webkit-clip-path: polygon(100% 51%, 96% 40%, 89% 29%, 80% 21%, 69% 13%, 57% 6%, 45% 3%, 30% 9%, 19% 14%, 8% 24%, 2% 34%, 0% 49%, 0% 62%, 4% 73%, 13% 84%, 24% 91%, 33% 97%, 44% 99%, 46% 89%, 55% 87%, 65% 86%, 76% 82%, 84% 75%, 92% 67%, 98% 58%);
clip-path: polygon(100% 51%, 96% 40%, 89% 29%, 80% 21%, 69% 13%, 57% 6%, 45% 3%, 30% 9%, 19% 14%, 8% 24%, 2% 34%, 0% 49%, 0% 62%, 4% 73%, 13% 84%, 24% 91%, 33% 97%, 44% 99%, 46% 89%, 55% 87%, 65% 86%, 76% 82%, 84% 75%, 92% 67%, 98% 58%);}
/* Center the demo */
html, body {
height: 100%;
}
@kaspereden
kaspereden / dabblet.css
Last active August 29, 2015 14:25
Untitled
div { width: 250px }
@kaspereden
kaspereden / getSearchParameters.js
Last active January 13, 2016 12:26
Get url parameters
function get(key) {
var searchParams = {},
search = window.location.search.substring(1); // substring to remove the ?
if (search) {
search = search.split('&');
for (var i in search) {
if (search.hasOwnProperty(i) && i !== '') {
var pair = search[i].split('=');
pair[0] = decodeURIComponent(pair[0]);
@kaspereden
kaspereden / dabblet.css
Last active August 29, 2015 14:27
Center the demo
div {
width: 279px;
height: 270px;
}
div.blaat{
mask-image: url(http://imgh.us/component.svg);
}
/* Center the demo */
html, body {
height: 100%;
<div class="table-container">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th></th>
<th>
Front-end
<small>een subtekst</small>
</th>
@kaspereden
kaspereden / contentblob.json
Created November 3, 2015 14:41
prismic.io demo
{
"type": "paragraph",
"text": "Het was 15 oktober, de dag dat het openbaar vervoer in Utrecht stil lag. Dat heeft 300 specialisten in het online vakgebied niet weerhouden naar het GX Connect event te komen. Een jaarlijks evenement van onze partner GX. Vanuit Incentro zijn we als vanouds aanwezig als sponsor, ditmaal vertellen wij het verhaal van neuropersonalisation vanuit het perspectief van de bakker. Daarnaast zijn we ook bij de sessies geweest, waarvan we hieronder verslagleggen.",
"spans": [
{
"start": 142,
"end": 147,
"type": "em"
},
{
@kaspereden
kaspereden / Day 1.js
Created December 16, 2015 09:01
Advent of code - day 1
var data = "((((()(()(((((((()))(((()((((()())(())()(((()((((((()((()(()(((()(()((())))()((()()())))))))))()((((((())((()))(((((()(((((((((()()))((()(())()((())((()(()))((()))()))()(((((()(((()()))()())((()((((())()())()((((())()(()(()(((()(())(()(())(((((((())()()(((())(()(()(()(())))(()((((())((()))(((()(()()(((((()()(()(((()(((((())()))()((()(()))()((()((((())((((())(()(((())()()(()()()()()(())((((())((())(()()))()((((())))((((()())()((((())((()())((())(())(((((()((((()(((()((((())(()(((()()))()))((((((()((())()())))(((()(()))(()()(()(((()(()))((()()()())((()()()(((())())()())())())((()))(()(()))(((((()(()(())((()(())(())()((((()())()))((((())(())((())())((((()(((())(())((()()((((()((((((()(())()()(()(()()((((()))(())()())()))(())))(())))())()()(())(()))()((()(()(())()()))(()())))))(()))(()()))(())(((((()(()(()()((())()())))))((())())((())(()(())((()))(())(((()((((((((()()()(()))()()(((()))()((()()(())(())())()(()(())))(((((()(())(())(()))))())()))(()))()(()(((((((()((((())))())())())())()((((((((((((((()(
@kaspereden
kaspereden / data.js
Created December 16, 2015 09:03
Advent of Code day 2
var data = ["20x3x11",
"15x27x5",
"6x29x7",
"30x15x9",
"19x29x21",
"10x4x15",
"1x26x4",
"1x5x18",
"10x15x23",
"10x14x20",