Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ index.sqlite
gline.js
gword.js
*.sublime*
cron.txt
1 change: 1 addition & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ koseu.php [L]
RedirectMatch 404 /\.git
</IfModule>

<IfModule !mod_rewrite.c>
Expand Down
35 changes: 35 additions & 0 deletions cron/cron.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

header("Content-Type: text/plain; charset=utf-8");

$dirname = dirname(__DIR__);
require_once $dirname."/tsugi/config.php";

$marker_file = __DIR__."/cron.txt";

$now = time();
if ( file_exists($marker_file) ) {
$file_time = filemtime($marker_file);
$delta = time() - $file_time;
} else {
$delta = 24*60*60;
}

/* ------------- Actual cron --------------- */

$ZIP_TIME = 30*60; // 30 Minutes

if ( $delta > $ZIP_TIME ) {
echo("\nRunning bash code.sh\n");
echo(system("cd .. ; bash code.sh"));
echo("\n\nRunning code cleanup.sh\n");
echo(system("cd ../code ; bash -vx cleanup.sh"));
echo("\n\nRunning code3 cleanup.sh\n");
echo(system("cd ../code3 ; bash -vx cleanup.sh"));
echo("\n\n");
touch($marker_file);
} else {
echo("Delta $delta z:$ZIP_TIME\n");
}


5 changes: 2 additions & 3 deletions vscode/Parsedown.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ protected function blockRule($Line)
#
# Setext

protected function blockSetextHeader($Line, array $Block = null)
protected function blockSetextHeader($Line, ?array $Block = null)
{
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
{
Expand Down Expand Up @@ -796,7 +796,7 @@ protected function blockReference($Line)
#
# Table

protected function blockTable($Line, array $Block = null)
protected function blockTable($Line, ?array $Block = null)
{
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
{
Expand Down Expand Up @@ -1177,7 +1177,6 @@ protected function inlineImage($Excerpt)
'attributes' => array(
'src' => $Link['element']['attributes']['href'],
'alt' => $Link['element']['text'],
'style' => 'max-width:100%;',
),
),
);
Expand Down