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
Flight::map('stream', function($resource){ | |
Flight::response()->sendHeaders(); | |
while ($buf = fread($resource, 1024)) { | |
echo $buf; | |
ob_flush(); | |
flush(); | |
} | |
exit(0); | |
}); |
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
FROM php:5.4-cli | |
COPY . / | |
ENTRYPOINT ["php"] | |
CMD ["/shutdown-with-goaop.php"] |
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
import net.sf.mpxj.MPXJException; | |
import net.sf.mpxj.ProjectFile; | |
import net.sf.mpxj.Task; | |
import net.sf.mpxj.mpp.MPPReader; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.*; | |
import java.util.logging.*; |
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
// \Podio::request | |
$raw_response = preg_replace('/^.*\r\n\r\nHTTP/s', 'HTTP', $raw_response); | |
$header = preg_split('/\r\n\r\n/s', $raw_response, 2)[0]; | |
$raw_headers_size = strlen($header) + 4; |
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
import re | |
import argparse | |
import os | |
import pprint | |
import mimetypes | |
parser = argparse.ArgumentParser(description='Listing transitive references.') | |
parser.add_argument('start', nargs='+', help='Starting file(s).') | |
parser.add_argument('--pattern', default='[\'"]([^\'":[\]]+\.(?:png|jpg|gif|xml|html?|php|js))[\'"]', | |
help='Regex for matching references. \ |
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 | |
# copy to: /etc/cron.hourly/check-wlan | |
# test with: sudo run-parts --test /etc/cron.hourly | |
if ifconfig wlan0 | grep "inet addr:" ; then | |
logger "wifi ok" | |
exit | |
else | |
logger "Network down! Attempting reconnection." |
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
// convert via https://mrcoles.com/bookmarklet/ | |
var tasks = prompt('Tasks mit Kommas abgetrennt eingeben:', 'Test planen,Testdaten definieren,Tests erstellen,Test durchführen & dokumentieren').split(','); | |
var match = window.location.pathname.match(/[A-Z]+-[0-9]+/); | |
if (match[0]) { | |
var task = match[0]; | |
var match = task.match(/[A-Z]+/); | |
var project = match[0]; | |
var promises = []; | |
for (var i = 0; i < tasks.length; i++) { |
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
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Scanner; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import org.apache.log4j.Logger; |
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
const minCharCode = Math.min(...'aAzZ019-_.:,'.toUpperCase().split('').map(c => c.charCodeAt(0))); | |
const maxCharCode = Math.max(...'aAzZ019-_.:,'.toUpperCase().split('').map(c => c.charCodeAt(0))); | |
const alphabetSize = maxCharCode - minCharCode + 2; | |
console.log(minCharCode, maxCharCode, alphabetSize, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER); | |
function toNumber(char) { | |
return char.toUpperCase().charCodeAt(0) - minCharCode + 1; | |
} |
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
import { Application, Router } from 'https://deno.land/x/oak/mod.ts'; | |
// Load environment variables | |
const PORT = 8080; | |
const TEAMS_WEBHOOK_URL = 'https://XYZ.webhook.office.com/webhookb2/XYZ'; | |
const TARGET_USERNAME = 'xyz'; | |
if (!TEAMS_WEBHOOK_URL || !TARGET_USERNAME) { | |
throw new Error('Missing required environment variables.'); | |
} |
OlderNewer