Generate random hash string in PHP
<?php
function randHash($len=32)
{
return substr(md5(openssl_random_pseudo_bytes(20)),-$len);
}
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: deep-gray; icon-glyph: magic; | |
// Licence: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 | |
// Author: Marcus Raitner (https://fuehrung-erfahren.de) | |
// Source: https://github.com/marcusraitner/COVID-19-Dashboard | |
// ## Changelog | |
// * 1.0.1: Correction of layout of label for covid-beds | |
// * 1.0.2: Bug-Fix for Saar-Pfalz-Kreis (using GEN instead of county for join) | |
// * 1.0.3: Bug-Fix for Landsberg a. Lech (now using both GEN and county) |
# Slack integration | |
require_once "$IP/extensions/Slack/Slack.php"; | |
# Slack extension configuration options | |
$wgSlackWebhookURL = "https://hooks.slack.com/services/some-webhook-url" | |
$wgSlackUserName = "batman"; | |
$wgSlackChannel = "#recent-changes"; | |
$wgSlackIconURL = "http://i.picresize.com/images/2015/09/20/tdpsU.jpg"; | |
$wgSlackLinkUsers = true; |
<?php | |
// This file walks you through the most common features of PHP's SQLite3 API. | |
// The code is runnable in its entirety and results in an `analytics.sqlite` file. | |
// Create a new database, if the file doesn't exist and open it for reading/writing. | |
// The extension of the file is arbitrary. | |
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE); | |
// Errors are emitted as warnings by default, enable proper error handling. |
<?php | |
// The code is inspired by the following discussions and post: | |
// http://stackoverflow.com/questions/5483851/manually-parse-raw-http-data-with-php/5488449#5488449 | |
// http://www.chlab.ch/blog/archives/webdevelopment/manually-parse-raw-http-data-php | |
/** | |
* Parse raw HTTP request data | |
* | |
* Pass in $a_data as an array. This is done by reference to avoid copying |
{ | |
"Records": [ | |
{ | |
"EventSource":"aws:sns", | |
"EventVersion":"1.0", | |
"EventSubscriptionArn":"arn:aws:sns:us-west-2:xxxx:xxxx", | |
"Sns": { | |
"Type":"Notification", | |
"MessageId":"88B1B251-2E92-4FC3-BFAA-E3BBD0BAB10A", | |
"TopicArn":"arn:aws:sns:us-west-2:881222951025:survey-tool-ses-delivery", |
## API Gateway "Send Everything" Mapping Template - Ryan Green - ryang@ryang.ca | |
## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html | |
#set($allParams = $input.params()) | |
{ | |
"body-json" : "$input.json('$')", | |
"params" : { | |
#foreach($type in $allParams.keySet()) | |
#set($params = $allParams.get($type)) | |
"$type" : { | |
#foreach($paramName in $params.keySet()) |
files: | |
"/home/ec2-user/install-cluster-client.sh": | |
mode: "000744" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash | |
#hide old ini | |
if [ -a /etc/php.d/50-memcached.ini ] | |
then |
<?php
function randHash($len=32)
{
return substr(md5(openssl_random_pseudo_bytes(20)),-$len);
}
{ | |
"Mississippi": [30.1477890014648, 34.9960556030273, -91.6550140380859, -88.0980072021484], | |
"Oklahoma": [33.6191940307617, 37.0021362304688, -103.002571105957, -94.4312133789062], | |
"Delaware": [38.4511260986328, 39.8394355773926, -75.7890472412109, -74.9846343994141], | |
"Minnesota": [43.4994277954102, 49.3844909667969, -97.2392654418945, -89.4833831787109], | |
"Illinois": [36.9701309204102, 42.5083045959473, -91.513053894043, -87.0199203491211], | |
"Arkansas": [33.0041046142578, 36.4996032714844, -94.6178131103516, -89.6422424316406], | |
"New Mexico": [31.3323001861572, 37.0001411437988, -109.050178527832, -103.000862121582], | |
"Indiana": [37.7717399597168, 41.7613716125488, -88.0997085571289, -84.7845764160156], | |
"Louisiana": [28.9210300445557, 33.019458770752, -94.0431518554688, -88.817008972168], |
location / { | |
if ($uri ~* ^/([^.\?/]+)) { | |
set $foldername "$1"; | |
} | |
sub_filter "<head>" "<head><base href=\"${scheme}://${host}/${foldername}/\">"; | |
} |