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
// get now date | |
LocalDateTime ldt = LocalDateTime.now(); | |
// tell him that this is Europe/Berlin | |
ZonedDateTime serverTime = ldt.atZone(ZoneId.of("Europe/Berlin")); | |
// then tell him to the same time but in another zone | |
ZonedDateTime playerTime = serverTime.withZoneSameInstant(ZoneId.of("UTC")); | |
System.out.println(serverTime); | |
System.out.println(playerTime); |
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
# This file contains the fastlane.tools configuration | |
# You can find the documentation at https://docs.fastlane.tools | |
# | |
# For a list of all available actions, check out | |
# | |
# https://docs.fastlane.tools/actions | |
# | |
# For a list of all available plugins, check out | |
# | |
# https://docs.fastlane.tools/plugins/available-plugins |
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/bash | |
if [ -z "$1" ]; then | |
myyear=`date +'%Y'` | |
echo "Please specifiy domain by calling e.g.: './createBundle.sh mydomain.com $myyear'" | |
exit -4 | |
fi | |
if [ -z "$2" ]; then | |
myyear=`date +'%Y'` |
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
class IP(userIp: String) { | |
def get: String = userIp | |
def getAnonimized: String = { | |
if (userIp.contains(":")) { | |
anonimizeIpV6(userIp) | |
} else if (userIp.contains(".")) { | |
anonimizeIpV4(userIp) | |
} else { |
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
# HTML part | |
#<div class="panel-group" id="accordion"> | |
# <f:cObject typoscriptObjectPath="lib.menu2" /> | |
#</div> | |
# TypoScript part | |
lib.menu2 = HMENU | |
lib.menu2 { | |
wrap = | |
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 | |
$config = array( | |
'fizz' => 3, | |
'buzz' => 5, | |
/* | |
'prim' => function($num) { | |
return in_array($num, array(1, 2, 3, 5, 7, 11, 13, 17, 19, 23)); | |
} | |
*/ | |
); |
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 | |
function blabla() { | |
try { | |
echo "try"; | |
return 1; | |
} catch (Exception $e) { | |
echo "catched"; | |
return 4; | |
} finally { | |
print "finally"; |
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 | |
/** | |
* Example class that holds an xml and adds magic getter and property accessors for xml nodes | |
* The class property annotations define type casts | |
* | |
* @property integer username | |
* @property string password | |
* @property array collection | |
* @property array car | |
* |
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 | |
/** | |
* class for cache control | |
*/ | |
final class CacheControl | |
{ | |
private function __construct() | |
{ | |
// no instances |
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 | |
/** | |
* Call callback function for every element of an array and provide some extra information for each element | |
* | |
* @param array $array | |
* @param Callback/Closure $callback | |
* Callback/Closure must have 6 parameters | |
* mixed key: key of item | |
* mixed value: value of item | |
* integer counter: human readable index of item; starts with 1 |