Skip to content

Instantly share code, notes, and snippets.

View akkerman's full-sized avatar

Marcel Akkerman akkerman

View GitHub Profile
@akkerman
akkerman / wgetit.sh
Last active December 21, 2015 07:58
Use wget to download a web page and pages it directly links to e.g. to download some documentation based on it's table of contents.
wget --recursive --level=1 --no-clobber --page-requisites --html-extension --convert-links --no-parent $@
@akkerman
akkerman / register.html
Last active March 15, 2026 17:46
registration form with basic validation
<!DOCTYPE html>
<html>
<head>
<title>Sign up to {this}</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<form method="post" target="#" onsubmit="return validate()">
@akkerman
akkerman / Install PostGIS and GeoServer on Ubuntu 13.04.md
Last active May 28, 2023 01:53
Install PostGIS and GeoServer on Ubuntu 13.04

Install PostGIS and GeoServer on Ubuntu 13.04

PostGIS installation

Postgresql

Install the server:

sudo apt-get install postgresql-9.1 postgresql-contrib-9.1 pgadmin3

Execute the psql command under user postgres (sudo -u postgres)
and connect to database postgres (psql postgres):

@akkerman
akkerman / git_alias.sh
Last active September 20, 2016 19:35
git alias
# open current directory in git kraken
git config --global alias.kraken '!gitkraken -p `pwd` >/dev/null 2>&1 &'
# revert a file
git config --global alias.revert 'reset HEAD --'
@akkerman
akkerman / bijlage-toevoegen.html
Created December 6, 2016 14:16
bijlage toevoegen
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
.form-group.required .control-label:after {
content:" *";
}
</style>
<div class="panel panel-default">
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData">
<edmx:Reference Uri="http://s4-1610.creetion.com:50000/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMON',Version='0001',SAP__Origin='')/$value" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common"/>
</edmx:Reference>
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema Namespace="EAM_OBJPG_MAINTNOTIFICATION_SRV" xml:lang="en" sap:schema-version="1" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
<EntityType Name="NotificationTypeImage" m:HasStream="true" sap:content-version="1">
<Key>
<PropertyRef Name="RequestImage"/>
@akkerman
akkerman / debounce.js
Last active April 4, 2018 09:25 — forked from nmsdvid/new_gist_file.js
Simple JavaScript Debounce Function
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
@akkerman
akkerman / fp-recipes.js
Last active June 14, 2021 08:06
functional javascript recipes
// transform array of objects to a dictionary object
const dict = arr => arr.reduce((result, item) => ({ ...result, [item.id]: item }), {}) // empty object as start value
// flatten an array of arrays
const flattened = arr => arr.reduce((result, arr) => result.concat(arr), []) // empty array as start value
// check if all elements in an array are in a source array
const hasAll = source => arr => arr.every(item => source.includes(item))
// check if any element in an array is in a source array
@akkerman
akkerman / NASA Picture-Of-The-Day Wallpaper Script
Last active October 16, 2024 05:21 — forked from curiousleo/NASA Picture-Of-The-Day Wallpaper Script
A BASH script to download NASA's picture of the day (http://apod.nasa.gov/apod/astropix.html) automatically saving and setting as wallpaper and saving optional description of image to text.
#!/bin/bash
# Copyright (c) 2011 Josh Schreuder
# http://www.postteenageliving.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
httpstatus () {
if [ -z $1 ]
then
w3m -dump -no-graph https://httpstatuses.com
else
w3m -dump -no-graph https://httpstatuses.com/$1 | sed -n '/-----/q;p' | ack -A 1000 'Status Code' | ack --passthru $1
fi
}