Skip to content

Instantly share code, notes, and snippets.

View ajslaghu's full-sized avatar

Lex Slaghuis ajslaghu

View GitHub Profile
@ajslaghu
ajslaghu / extract_emails_from_text.py
Created May 17, 2018 08:53 — forked from dideler/example.md
A python script for extracting email addresses from text files. You can pass it multiple files. It prints the email addresses to stdout, one address per line. For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.
#!/usr/bin/env python
#
# Extracts email addresses from one or more plain text files.
#
# Notes:
# - Does not save to file (pipe the output to a file if you want it saved).
# - Does not check for duplicates (which can easily be done in the terminal).
#
# (c) 2013 Dennis Ideler <ideler.dennis@gmail.com>
@ajslaghu
ajslaghu / whitepsace.sh
Created February 19, 2018 15:26
Whitepacse
input.xml | sed -r 's~((=")([^" ]|"")*)( )+(([^"]|"")*("([?]|[ ]|[>]|[\n]|[//])))~"\1\5"~g' > output.xml
@ajslaghu
ajslaghu / gist:d641cbf220802edb1ea012ad9f4d58cb
Created May 16, 2017 13:05
Snippet for updating links in wordpress on docker setup
#!/bin/bash
echo param is $1
# DUMPING A TABLE
MYSQL=c-mysql
CLI=i-mysql-cli
HOSTPATH=/srv/wp-mu/data/mysql
DOCKERPATH=/mnt/data
http://www.utrecht.nl/fileadmin/uploads/documenten/7.extern/wob/2014_SSLU_luchtberekeningen_megabioscoop/140325-verkeersgegevens_megabioscoop_groter_dan_250.xls
http://www.utrecht.nl/fileadmin/uploads/documenten/7.extern/wob/2014_SSLU_megabioscoop_2/140325-Invoersjabloon-2015-met-en-zonder-megabioscoop.xls
http://www.utrecht.nl/fileadmin/uploads/documenten/7.extern/wob/2014_SSLU_megabioscoop_2/140325-Invoersjabloon-2020-Vru3.1.xls
http://www.utrecht.nl/fileadmin/uploads/documenten/7.extern/wob/2014_SSLU_segs_verkeersmodellen/NGV_VRU_2.0_UTR2.2.xlsx
http://www.utrecht.nl/fileadmin/uploads/documenten/7.extern/wob/2014_SSLU_segs_verkeersmodellen/vru2.0_utr2.1_2010_verkeersgeneratie.xls
http://www.utrecht.nl/fileadmin/uploads/documenten/7.extern/wob/2014_SSLU_segs_verkeersmodellen/VRU2.0UTR2.2_2015_verkeersgeneratie.xlsx
http://www.utrecht.nl/fileadmin/uploads/documenten/7.extern/wob/2014_SSLU_segs_verkeersmodellen/VRU3.1U_inw_en_arbpl_2010_2015_en_2020.xlsx
http://www.utrecht.nl/fileadmin/uploads/documenten/7.ex
http://www.rotterdam.nl/JOS/Document/begroting_bij_subsidieaanvraag.xls
http://www.rotterdam.nl/DG%20Kralingen%20Crooswijk/Document/documenten%202011/Iwap%202011%20Kralingse%20Bos.xls
http://www.rotterdam.nl/DG%20Hoogvliet/Document/Tabellenboek%20Meeuwenplaat_v1.XLS
http://appl.gemeentearchief.rotterdam.nl/docs/Informatie_en_archiefbeheer/presentaties/Risicotool_informatiebeheer.xls
http://www.rotterdam.nl/Clusters/Maatschappelijke%20ontwikkeling/PDC/Formulier%20meerjarenbegroting%20Poppodium.xls
http://www.rotterdam.nl/JOS/Document/Welzijn/Bloem_en_doelenboom_digitaal.xls
http://www.rotterdam.nl/DG%20Kralingen%20Crooswijk/Document/documenten%202011/Iwap%202011%20Rubroek.xls
http://www.rotterdam.nl/DG%20Kralingen%20Crooswijk/Document/documenten%202011/Iwap%202011%20deelgemeentebreed.xls
http://www.rotterdam.nl/DG%20Hillegersberg%20-%20Schiebroek/Wordbestanden/2010-03-15%20-%20PS%20uitslagen%20deelgemeente%20HIS%202.xls
http://www.rotterdam.nl/Clusters/Stadsontwikkeling/Document%202014/EVR/3.%20Hoofdstuk%203%2
@ajslaghu
ajslaghu / gist:a4a90916687c74ac53a4
Created February 26, 2015 12:58
Open State Crawl van data files van gemeente amsterdam welke niet in Datacatalogus zitten.
2014 Legestabel conversie,xls,0,http://www.regelgeving.amsterdam.nl/amsterdamnoord/legesverordening_2014/20140101/legestabel_legesverordening_2014.xls
afvalwijzer stratenlijst 2014 (XLS, 157 kB) - Stadsdeel ...,xls,156,http://www.nieuwwest.amsterdam.nl/publish/pages/427015/afvalwijzer_stratenlijst_2014.xls
Leges tabel 2006,xls,285,http://www.noord.amsterdam.nl/publish/pages/490221/legestabel_2006_wijziging_paspoorten.xls
Lijst beschermwaardige houtopstanden Oost (XLS, 123 kB),xls,123,http://www.oost.amsterdam.nl/publish/pages/472331/20130416_lijst_van_beschermwaardige_houtopstanden_oost.xls
stadsarchief.amsterdam.nl,xls,108,http://stadsarchief.amsterdam.nl/actueel/nieuws/nieuwsarchief/oud_nieuws_2009/kwartaal_1-2009/egodocumenten.xls
www.amsterdam.nl,xls,0,http://www.amsterdam.nl/publish/pages/135610/deelnemerslijst8_april.xls
www.amsterdam.nl,xls,0,http://www.amsterdam.nl/publish/pages/173862/begroting_aangepast_vervoer.xls
www.amsterdam.nl,xls,0,http://www.amsterdam.nl/publish/pages/173862/begrotingregelmat
@ajslaghu
ajslaghu / bol.php
Last active August 29, 2015 14:05
Bol.com Open API example script for Dutch Open Hackathon
<?php
//Requires: extension=php_openssl.dll in php.ini
// Based on bol.com REST API version 4.0
// No rights may be derived from this codesample
// Any questions? Check out the API documentation at http://developers.bol.com
// set apikey
$apiKey = '___your_apikey___';
$server = 'openapi.bol.com';
@ajslaghu
ajslaghu / hue.php
Created August 5, 2014 13:24
A script that demonstrates local API use of Philips Hue
<?php
$username = 'newdeveloper';
$red = 65000;
$green = 25000;
$html = file_get_contents('https://www.meethue.com/api/nupnp');
$jsonpnp = json_decode($html);
@ajslaghu
ajslaghu / RSS_OCD_API.theme
Last active August 29, 2015 14:03
RSS_OCD_API.theme
[Theme]
DisplayName=RSS_OCD_API
[Slideshow]
Interval=1800000
Shuffle=1
RssFeed=http://search.opencultuurdata.nl/rss/rss.php
[Control Panel\Desktop]
TileWallpaper=0
WallpaperStyle=0
Pattern=
@ajslaghu
ajslaghu / yodlee_data.json
Created June 13, 2014 08:53
The Example data from Yodlee while quering on transaction level
[
{
"itemId": 10034580,
"contentServiceId": 11195,
"contentServiceInfo": {
"contentServiceId": 11195,
"siteId": 8995,
"containerInfo": {
"containerName": "bank",
"assetType": 1