Skip to content

Instantly share code, notes, and snippets.

View mihaeu's full-sized avatar
💭
🏳️‍🌈

Michael Haeuslmann mihaeu

💭
🏳️‍🌈
View GitHub Profile
// *************************************************
// include jQuery and lightbox2
// *************************************************
/*!
* jQuery JavaScript Library v2.1.4
* http://jquery.com/
*
* Includes Sizzle.js
<?php declare(strict_types = 1);
class XCollection implements Countable, IteratorAggregate
{
/**
* @var SplObjectStorage
*/
private $x;
public function __construct()
<?php declare(strict_types = 1);
class XCollection implements Countable, IteratorAggregate
{
/**
* @var X[]
*/
private $x;
public function __construct()
# Shortcuts
Actions: Ctrl + Shift + A
Search everywhere: 2x Shift
Next occurence: Alt + J
Local insert: Alt + Insert
Create file: Ctrl + Alt + Insert
Open class: Ctrl + N
Run: Shift + F10
Extract method: Ctrl + Alt + M
@mihaeu
mihaeu / print-php-scripts.sh
Created January 3, 2016 17:18
work in progress ... I'll be using this to print the source code of my live coding exam at university
author="Michael Haeuslmann"
path='/home/mike/workspace/pw-online-auction/'
save_path='\/home\/mike\/workspace\/pw-online-auction\/'
output="test.pdf"
printf "# Prüfung Professionelle Webentwicklung\n\nAuthor: $author\n\nDatum: `date`\n\n" > test.md
find $path -type f -name '*.php' -print0 | while IFS= read -r -d '' file; do
printf '%s\n' "$file"
printf "##" >> test.md
echo $file | sed "s/$save_path//" >> test.md
@mihaeu
mihaeu / OnlineShopper
Created June 3, 2015 11:19
Compares and finds the cheapest options for online shopping (prices, shipping, vouchers).
<?php
// Online - Shops
// --------------
//
// NOTE:
// - Shipping costs conditions must be valid PHP expressions.
// - Prices must be integers with the decimals included, so 5.00 becomes 500.
// - The shipping cost conditions have to be ordered from lowest to greatest, otherwise computation will be wrong.
//
@mihaeu
mihaeu / gist:aae8aa7c5450f6b8552d
Last active August 29, 2015 14:12
Create a nice program structure for the current Windows user [XP/7/8]
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AUDIO"
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\DESIGN"
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\GAMES"
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\INTERNET"
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MISC"
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\OFFICE"
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\SYSTEM"
mkdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\VIDEO"