Skip to content

Instantly share code, notes, and snippets.

View JeroenSteen's full-sized avatar

Jeroen JeroenSteen

View GitHub Profile
@JeroenSteen
JeroenSteen / printerPartnumbers.json
Last active January 23, 2024 15:54
Printer partnumbers with region and metered or sold info, printermodels found on https://lapatushka.com/#RFIDTag
{
"Xerox CC/WC C/M 118/ 123/ 128/ 133 (Mono)": {
"black": {
"006R01182": {
"region": "",
"m/s": "",
"type": "toner"
}
}
},
<?php
//We're delivering it ourself, so..
if($this->deliveryMethod == "hood") {
//Get VAT for delivery
$this->deliveryCostsVat = $this->getVat($this->deliveryCosts);
//Add delivery costs
$totalEditionCosts += $this->deliveryCosts;
//Bullshit variable, to fool the world
@JeroenSteen
JeroenSteen / postnl_postage_costs.json
Created April 6, 2022 16:06
Postage costs for PostNL in JSON format
{
"letters": {
"Brief 0 - 20 g": {
"max_grams": 20,
"max_dimensions_mm": [324,229],
"price": 0.96
},
"Brief 20 - 50 g": {
"max_grams": 50,
"max_dimensions_mm": [324,229],
@JeroenSteen
JeroenSteen / omnistreets_select_data.php
Last active May 29, 2020 16:58
Omnistreets select data
<?php
/*
Find houses from postcode, split by odd and even, simply order by geolocation
With help from Lukasz Szozda, https://stackoverflow.com/questions/59490951/query-to-split-even-and-odd-numbers-with-group-concat
*/
$find_houses_from_postcodes_split_sql = "
SELECT street
,GROUP_CONCAT(DISTINCT CASE WHEN MOD(CAST(housenumber AS int),2) = 0 THEN CAST(housenumber AS int) END ORDER BY housenumber ASC) AS housenumbers_even
@JeroenSteen
JeroenSteen / soundcloud_fetcher.php
Last active May 11, 2020 14:08
Get songs from Soundcloud artist
<?php
//https://helgesverre.com/blog/fetch-info-from-soundcloud-api/
$setting_ksart_user_id = 50;
$setting_ksart_creator_name = "cascosongs";
$setting_soundcloud_user_name = "cascosongs";
$setting_soundcloud_client_id = "MyeFEFZmDltbdw3XrgBZEUGlbDpDgV5p";
// build our API URL
$url = "http://api.soundcloud.com/resolve.json?"
@JeroenSteen
JeroenSteen / download_wdka_portfolios.php
Created May 11, 2020 13:57
Download portolio websites from WDKA students
<?php
ini_set('memory_limit', '-1');
//http://0188353.student.wdka.nl/
foreach(range (999999,111111,1) as $i) {
$s = str_pad($i, 7, "0", STR_PAD_LEFT);
$wget = "wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains wdka.nl --no-parent http://".$s.".student.wdka.nl/".PHP_EOL;
echo $wget.PHP_EOL;
@JeroenSteen
JeroenSteen / allowed_ip.php
Last active May 11, 2020 13:53
Allow only one IP
<?php
$allowed_ip = ''; //https://watismijnip.nl/
// Function to get the client ip address
function get_client_ip_env() {
$ipaddress = '';
if (getenv('HTTP_CLIENT_IP'))
$ipaddress = getenv('HTTP_CLIENT_IP');
else if(getenv('HTTP_X_FORWARDED_FOR'))
@JeroenSteen
JeroenSteen / KVK_handelsnamen.js
Last active May 9, 2020 11:17
Get 'handelsnamen' from KVK
all_handelsnamen = '';
function get_handelsnamen() {
handelsnamen = '';
$('h3.handelsnaamHeader > a').each(function(pl) {
handelsnamen += $( this ).html()+"\n";
});
//handelsnamen += "\n";
return handelsnamen;
}
@JeroenSteen
JeroenSteen / Make Indesign document with Scripting
Last active August 10, 2016 17:57
Create Indesign document Script
//SRA3 size
var x = 320;
var y = 450;
function range(start, stop, step){
var a=[start], b=start;
while(b<stop){b+=step;a.push(b)}
return a;
};
@echo off
start "" "C:\Program Files (x86)\JetBrains\PhpStorm 7.0\bin\PhpStorm.exe"
start "" "C:\Program Files (x86)\Git\bin\sh.exe" --login -i
start "" "C:\xampp\xampp-control.exe"
start "" "%windir%\system32\notepad.exe"
"C:\Users\THEUSER\AppData\Local\Google\Chrome\Application\chrome.exe"
start "Facebook" "http://www.facebook.com/"
start "Outlook" "http://www.outlook.com/"