Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeroen JeroenSteen

View GitHub Profile
View omnistreets_select_data.php
<?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
Get songs from Soundcloud artist
View soundcloud_fetcher.php
<?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
Download portolio websites from WDKA students
View download_wdka_portfolios.php
<?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
Allow only one IP
View allowed_ip.php
<?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
Get 'handelsnamen' from KVK
View KVK_handelsnamen.js
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 Aug 10, 2016
Create Indesign document Script
View Make Indesign document with Scripting
//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;
};
View batch.bat
@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/"