Skip to content

Instantly share code, notes, and snippets.

View sdennler's full-sized avatar

Samuel Dennler sdennler

View GitHub Profile
<?php
$l = range('A', 'I');
for($i=123456789; $i<=987654321; $i++){
$a = str_split((string)$i);
if(9 <> count(array_unique($a))) continue;
if(in_array('0', $a)) continue;
$a = array_combine($l, $a);
if($a['A'] - $a['B'] != $a['C']) continue;
<?php
$checksum = 4;
for ($i=0; $i<10000; $i++) {
if ($checksum === array_sum(str_split($i))) {
$n = $i/28.821;
$e = $i/44.852;
echo sprintf("N47 %02.3f E08 %02.3f %04d\n", $n, $e, $i);
}
}
@sdennler
sdennler / IP Ranges List.ods
Last active September 1, 2022 06:21
Create a rainbow table with IPv4 addresses
Ads the CHE nummber to the top of the company description.
@sdennler
sdennler / gansHuehnSpaz.php
Created June 24, 2019 21:12
Gans Huehn Spaz
I ha o äs rätsu: Hesch 100 Franke. 5 Franke für ä Gans, 1 Franke für äs huehn und 5 RP für ä Spatz. Am Schluss 0 Gäud und 100 Viecher.
100 Hüener?
Nei vo jedem Viehch mindestens 1!
Ok, dämfau:
<?php
for($gans=1; $gans<=20; $gans++){
for($huehen=1; $huehen<=100; $huehen++){
@sdennler
sdennler / GC7NYWX.csv
Last active June 6, 2019 06:47
Entwicklung Zürich West (GC7NYWX)
Bewehrungsstahl to Konstruktionsbeton m³ Baukosten Mio CHF
1 Löwenbräu-Areal 2'950.00 22'400.00 27.00
2 Escherterrassen 1'143.00 10'795.00 13.00
3 Platform 1'610.00 13'620.00 12.00
4 Maaghof 1'990.00 20'490.00 14.00
5 ARGE City West 2'830.00 25'330.00 15.00
6 Mobimo-Tower 2'815.00 21'890.00 20.00
7 Schlotterbeck-Areal 1'180.00 26'020.00 16.00
8 Toni-Areal 3'425.00 25'920.00 36.00
9 Hardturmpark Baufeld C 3'175.00 21'160.00 20.00
// ==UserScript==
// @name MS Login Shizzle
// @namespace http://tampermonkey.net/
// @version 1
// @description try to fix the world!
// @author Sad
// @match https://login.microsoftonline.com/common/oauth2/logout
// @grant none
// ==/UserScript==
@sdennler
sdennler / dumprequest.php
Last active August 18, 2017 15:12 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method/HTTP headers and request body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequest {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
);
@sdennler
sdennler / combineGCFounds.php
Last active April 26, 2017 10:57
Reads GeoCaching GPX files and combines them to one CSV
<?php
/**
* Reads GeoCaching GPX files (GPX files whit GeoCache data in groundspeak extendion)
* and creates a CSV file 'result.csv' in the current folder whit all found caches.
* @version 1
* @author https://github.com/sdennler
*/
#include '../SadWebTools/lib/sad.php';
function fish_prompt --description 'Prompt anzeigen'
set -l last_status $status
# Just calculate these once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end
if not set -q __fish_prompt_normal