This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PING test targets | |
ping_targets="example.org" | |
# HTTP STATUS test targets | |
status_targets="http://example.org:5000" | |
# Notification recipients | |
mail_to="arthur.dent@42.galaxy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* I was explaining how strings and arrays are stored differently in RAM to my | |
* students and I told them, that array imploding is much more efficient than | |
* traditional string concatenation. | |
* | |
* I created this benchmark to prove my point. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculate brightness value by RGB or HEX color. | |
* @param color (String) The color value in RGB or HEX (for example: #000000 || #000 || rgb(0,0,0) || rgba(0,0,0,0)) | |
* @returns (Number) The brightness value (dark) 0 ... 255 (light) | |
*/ | |
function brightnessByColor (color) { | |
var color = "" + color, isHEX = color.indexOf("#") == 0, isRGB = color.indexOf("rgb") == 0; | |
if (isHEX) { | |
var m = color.substr(1).match(color.length == 7 ? /(\S{2})/g : /(\S{1})/g); | |
if (m) var r = parseInt(m[0], 16), g = parseInt(m[1], 16), b = parseInt(m[2], 16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "This script updates your moodle installation." | |
echo "You will need a few pieces of information to complete this process." | |
echo "" | |
echo "Warning: This will disable Web-Access to the moodle installation!" | |
echo "Make sure nobody is logged in at the moment or activate maintenance mode manually so no data is lost." | |
echo "" | |
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Get an access token here: | |
# https://developers.facebook.com/tools/explorer/ | |
# | |
# Get the album id from the url when watching the album | |
# in your browser. | |