Browse Source

Removed history to remove references to password

master
dirkson 7 months ago
commit
b7497cbb14
16 changed files with 6286 additions and 0 deletions
  1. 9
    0
      .gitignore
  2. 21
    0
      README.md
  3. 27
    0
      Tupfile
  4. 4
    0
      src/404.md
  5. 3
    0
      src/500.md
  6. 8
    0
      src/canary.md
  7. 253
    0
      src/cgui.md
  8. 10
    0
      src/contact.md
  9. 39
    0
      src/dep/Exception.php
  10. 4502
    0
      src/dep/PHPMailer.php
  11. 1326
    0
      src/dep/SMTP.php
  12. BIN
      src/img/ico/favicon.ico
  13. 25
    0
      src/index.md
  14. 57
    0
      src/submit.php
  15. 1
    0
      src/theme/footer.html
  16. 1
    0
      src/theme/header.html

+ 9
- 0
.gitignore View File

@@ -0,0 +1,9 @@
#Vim files
*.un~
*.swp
# Object files
obj/*
# Build framework
.tup
# Output
web/*

+ 21
- 0
README.md View File

@@ -0,0 +1,21 @@
# OrangeHatTech.com Website

This repository contains the code for the orangehattech.com public-facing website.

It utilizes The tup build system to package the website for production.

To build:

```
tup init
tup
```

All source files are in 'src'
All output files will be put put in 'web'

## Todo

* Improve header source formatting
* Strip hat out of header, add to http2 push


+ 27
- 0
Tupfile View File

@@ -0,0 +1,27 @@
#Figure out newest article
#: |> cp src/news/`ls src/news -t | head -1` %o; |> obj/news.md

#Cmark all the .md
: foreach src/*.md |> cmark %f > %o |> obj/cmark/%B.html

#minify all html
: foreach src/theme/*.html |> minify %f > %o |> obj/theme/%B.html
: foreach obj/cmark/*.html |> minify %f > %o |> obj/min/%B.html

#Concat all webpages
: foreach obj/min/*.html | obj/theme/*.html |> cat obj/theme/header.html %f obj/theme/footer.html > %o |> web/%B.html

#Scour and output svg
#: foreach src/svg/* |> scour3 --shorten-ids --set-precision=1 --no-line-breaks --strip-xml-space --enable-viewboxing --enable-comment-stripping --remove-descriptive-elements --strip-xml-prolog --indent=none %f %o |> web/%b
#Hi! My name is svgcleaner. I eat SVGs. No idea why.
#: foreach src/svg/* |> svgcleaner %f %o |> web/%b

#Minify css
: src/theme/*.css |> minify %f > %o |> web/%b

#Move all our unchanged stuff to the final output dir
: foreach src/img/ico/*.ico src/*.php obj/theme/*.html |> cp %f %o |> web/%b
: foreach src/dep/*.php |> cp %f %o |> web/dep/%b

#Brotli compression
: foreach web/*.html web/*.svg web/*.css |> brotli %f -o %o |> web/%b.br

+ 4
- 0
src/404.md View File

@@ -0,0 +1,4 @@
# Error 404

I can't quite seem to find that, sorry!


+ 3
- 0
src/500.md View File

@@ -0,0 +1,3 @@
# Error 500

PHP has probably fallen over. Sorry, I'll try to fix that ASAP.

+ 8
- 0
src/canary.md View File

@@ -0,0 +1,8 @@
## Warrant Canary

This page will be updated on January 1st and July 1st of each year. Ask me once to update if I forget.

As of January 2019, I have not received any national security letters, or any other gag order from governmental agencies.




+ 253
- 0
src/cgui.md View File

@@ -0,0 +1,253 @@
## C Gui Libraries

So you've decided to code a GUI in C. That's probably a horrible decision. But hey, I've made that horrible decision a bunch of times myself, so I can help!

This document has a lot of my own biases in it, and I haven't used most of the tools I'm writing about. I'd recommend that you do your own research before coming to strong conclusions. This document is a starting point, not an ending point.

LGPL is listed as a negative. This is because most people who care about a library being LGPL care because they have to avoid LGPL'd code. (Usually for static linking with closed source software)

---

### Cross platform libraries

---

*Code once, use everywhere. Generally "Everywhere" in this context is Windows, Linux, BSD, and OSX. Android apps have a complicated relationship with C code, and I don't know much about them.*

#### <a href=https://github.com/vurtun/nuklear>Nuklear</a>

I've used this library extensively. It's my personal favorite.

<ul>
<li class=p>Simple to use
<li class=p>Extremely flexible
<li class=p>Can render via opengl2/3, sdl, allegro, x11(lin), d3d(win), and gdi(win).
<li class=p>Can be used to create GUIs inside existing rendering contexts.
<li class=p>Public Domain licensed
<li>Requires the use of a separate context-creation library.
<li class=n>Everything is implemented in a single monolithic header file.
<li class=n>Doesn't provide a native look and feel on any platform
</ul>

<h4><a href=https://github.com/andlabs/libui>Libui</a></h4>

I haven't yet used this.
<ul>
<li class=p>Provides a native look and feel.
<li class=p>MIT Licensed
<li class=n>Can't be used to render to existing contexts
</ul>

<h4><a href=http://webserver2.tecgraf.puc-rio.br/iup/>IUP</a></h4>

I've used this library.
<ul>
<li class=p>Cross platform <li class=n>Code once, use everywhere. Except Mac.
<li class=p>Provides a native look and feel.
<li class=n>Doesn't run on OSX.
</ul>

<h4><a href=http://libagar.org/>LibAgar</a></h4>

I've used this, but ran into a breaking bug that I couldn't fix and the author didn't seem interested in fixing.

<ul>
<li class=p>Can be used to create GUIs inside existing rendering contexts.
</ul>

<h4><a href=https://www.gtk.org/>GTK+</a></h4>

I haven't used this directly.

<ul>
<li class=p>Arguably the closest equivalent Linux has to a native GUI toolkit.
<li class=n>LGPL license - No static compilation with arbitrarily licensed software
<li class=n>Can't be used to render to existing contexts
<li class=n>Difficult to utilize outside of Linux. (Partially due to LGPL licensing)
</ul>

<h4><a href=https://github.com/cimgui/cimgui>c-imgui</a></h4>

I haven't used this.

<ul>
<li class=p>MIT Licensed
<li class=p>Can be used to create GUIs inside existing rendering contexts.
<li class=n>Wrapper for a C++ project.
<li class=n>Doesn't provide a native look and feel on any platform
</ul>

<h4><a href=https://github.com/lc-soft/LCUI>LCUI</a></h4>

I haven't used this and I can't imagine how it could possibly work.

<ul>
<li class=p>MIT Licensed
<li class=n>Doesn't provide a native look and feel on any platform
</ul>

<h4><a href=https://sourceforge.net/projects/tinyfiledialogs/>Tinyfiledialogs</a></h4>

I've used this. It was ok.

<ul>
<li class=p>ZLIB/PNG Licensed
<li class=n>Only exposes a few pre-made dialogs
<li class=n>Everything is implemented in a single monolithic header file.
</ul>

<h4><a href=https://git.orangehattech.com/dirkson/boksi>Boksi</a></h4>

I made this. It's ok. It uses many of the libraries listed on this page to do its thing.

<ul>
<li class=p>MIT Licensed
<li class=p>Extremely small, due to its use of dynamic loading to find an appropriate library.
<li class=n>Only exposes an error box style dialog.
<li class=n>Not particularly mature codebase.
<li class=n>Dev is kinda funny looking.
</ul>

<h4><a href=https://github.com/raysan5/raygui>Raygui</a></h4>

I haven't used this yet

<ul>
<li class=p>Zlib Licensed
</ul>

<h4><a href=https://en.wikipedia.org/wiki/Tk_(software)>Tk</a></h4>

I haven't used this.

<ul>
<li class=n>Requires the use of an uncommon language (TCL) to specify the gui.
<li class=n>Can't be used to render to existing contexts
</ul>


<h4><a href=http://wxc.sourceforge.net/>WxC</a></h4>

An effort to expose WxWidgets to C.
<ul>
<li class=n>Last updated in 2013
</ul>


<h4><a href=http://www.xvt.com/>XVT</a></h4>

<ul>
<li class=p>Provides a native look and feel.
<li class=p>Allows visual editing of GUIs.
<li class=n>Crazy expensive. Wow. Wow so crazy expensive. Just buy a car instead.
<li class=n><strong>Closed source software</strong>
</ul>

<hr/>

<h3>Single platform libraries</h3>

<hr/>

<em>You'll need to code a separate solution for each targeted platform. Worth considering if you only need to target a single platform for whatever reason.</em>

<h4>Win32 libs</h4>

I haven't used this directly.

<ul>
<li>Windows only
<li class=p>Native library
<li class=p>Windows is probably the world's most popular OS, for reasons beyond the ken of mortal man
<li class=n>Can't be used to render to existing contexts
</ul>

<h4>Xaw</h4>

I've used this library lightly.

<ul>
<li>Linux/X11 only
<li class=p>Easy to use
<li class=n>Generally considered outdated
</ul>

<h4>Motif</h4>

I don't have experience with this one.

<ul>
<li>Linux/X11 only
<li class=n>Generally considered outdated
</ul>


<h4><a href=https://en.wikipedia.org/wiki/XForms_(toolkit)>XForms</a></h4>

I don't have experience with this one.


<ul>
<li>Linux/X11 Only
<li class=p>Allows visual editing of GUIs.
<li class=n>LGPL
</ul>


<hr/><h3>Similar libraries</h3><hr/>

<p><em>Sometimes you're doing something weird, and you need lower level access than most GUI libraries will provide. Don't worry, you can always roll you own!</em>

<p><em>Oh, and on a personal note? 9 times out of 10, you're making a mistake somewhere if you're looking at these libraries. It's extremely likely that you can use something else to get a better result with less coding.</em>

<h4>XLib</h4>

I don't have experience with this one.

<ul>
<li class=n>Linux/X11 only
<li class=n>Generally considered outdated: XCB is preferred for modern applications.
</ul>

<h4>XCB</h4>

I don't have experience with this one. Modern replacement for XLib

<ul>
<li class=n>Linux/X11 only
</ul>

<h4>Xt</h4>

I don't have experience with this one. Built on xlib. Powers XAW and Motif.

<ul>
<li class=n>Linux/X11 only
<li class=n>Generally considered outdated
</ul>

<h4><a href=https://en.wikipedia.org/wiki/GDK>GDK</a></h4>

I don't have direct experience with this one.

<ul>
<li>Powers GTK+
<li class=n>Linux/X11 only
<li class=n>LGPL
</ul>


<h4><a href=https://github.com/memononen/nanovg>NanoVG</a></h4>

I've used this. Stands for Nano Vector Graphics.

<ul>
<li class=p>Cross platform
<li class=p>Small
<li class=p>Easy to use
<li class=p>Fast
<li class=p>Many back ends
<li class=p>Exposes access to vector graphics
<li class=n>Low level
</ul>


+ 10
- 0
src/contact.md View File

@@ -0,0 +1,10 @@

<form action="submit.php" method="post">
<input style=margin:auto;width:80%;padding:10px placeholder="Your Email Address" type=email name=e required><br><br>
<textarea style=padding:10px;margin:auto;width:80%;height:20em placeholder="Type your Message Here...." name=m required></textarea><br><br>
<input type="hidden" name="recaptcha_response" id="recaptchaResponse">
<button style=width:20em;height:4em name=submit type=submit>Send</button>
</form>

<script src='https://www.google.com/recaptcha/api.js?render=6Lcfr4oUAAAAAEVYJi9cnZSYOIjP5PRDesVteHuk'></script>
<script>grecaptcha.ready(function () {grecaptcha.execute('6Lcfr4oUAAAAAEVYJi9cnZSYOIjP5PRDesVteHuk', { action: 'contact' }).then(function (token) {var recaptchaResponse = document.getElementById('recaptchaResponse');recaptchaResponse.value = token;});});</script>

+ 39
- 0
src/dep/Exception.php View File

@@ -0,0 +1,39 @@
<?php
/**
* PHPMailer Exception class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2017 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/

namespace PHPMailer\PHPMailer;

/**
* PHPMailer exception handler.
*
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
*/
class Exception extends \Exception
{
/**
* Prettify error message output.
*
* @return string
*/
public function errorMessage()
{
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
}
}

+ 4502
- 0
src/dep/PHPMailer.php
File diff suppressed because it is too large
View File


+ 1326
- 0
src/dep/SMTP.php
File diff suppressed because it is too large
View File


BIN
src/img/ico/favicon.ico View File


+ 25
- 0
src/index.md View File

@@ -0,0 +1,25 @@
Hi there!

I'm Jeff, and I've been operating as the "Orange Hat Tech" for several years now. I do whatever technical work happens to cross my path. Currently, I'm:

* Writing <a href="https://git.orangehattech.com/dirkson">MIT Licensed, C99 libraries</a>
* Trying to make the world's most accurate butter-based space combat simulator, <a href=https://scrumbleship.com/>ScrumbleShip</a>.
* Administering my linux server out of Kansas City, where it runs the various websites and services I provide people.

In the past, I've:

* Administered linux servers for frogstar.com, a Minecraft server, and the Zen Community of Oregon.
* Fixed computers for small businesses and anyone else who needed it.
* Messed around with <a href=cgui>C GUI libraries</a>
* Built a few websites using a system called Drupal.
Administered the minecraft server <a href=http://www.dirkocraft.net/ rel=nofollow>Dirkocraft</a>
* Taught various computer courses for my local city's recreation department.
* Discovered and explored several small caves.

If you need to contact me, <a href=contact>please click here.</a>

If you like small birds and government gag orders, <a href=canary>please click here.</a>

Cheers,

-Jeff

+ 57
- 0
src/submit.php View File

@@ -0,0 +1,57 @@
<?php

require 'dep/PHPMailer.php';
require 'dep/SMTP.php';
require 'dep/Exception.php';
use PHPMailer\PHPMailer\PHPMailer;

include('header.html');

if ($_SERVER['REQUEST_METHOD'] != 'POST') {
echo "<h3>Captcha issue. Sorry! Please try again.</h3></div><br></div>";
return false;
}

include 'dep/passwords.php';

$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_secret = '6Lcfr4oUAAAAAOGq_qmr43e66cqbXSAj9yVbmb6e';
$recaptcha_response = $_POST['recaptcha_response'];

$recaptcha = file_get_contents($recaptcha_url . '?secret=' . $recaptcha_secret . '&response=' . $recaptcha_response);
$recaptcha = json_decode($recaptcha);

if ($recaptcha->score < 0.5) {
echo "<h3>Captcha issue. Sorry! Please try again.</h3></div><br></div>";
return false;
}


$mail = new PHPMailer(true);

$mail->isSMTP();
$mail->Host = 'smtp.zoho.com';
$mail->SMTPAuth = true;
$mail->Username = $smtpusername;
$mail->Password = $smtppassword;
$mail->Port = 465;
$mail->SMTPSecure = 'ssl';

$mail->From = 'noreply@orangehattech.com';
$mail->FromName = 'orangehattech.com';
$mail->addAddress('jeff@orangehattech.com'); // Add a recipient
$mail->addReplyTo($_POST['e']);

$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->Subject = 'OHT Contact';
$mail->Body = $_POST['m'];

if(!$mail->send()) {
echo "Message could not be sent. Sorry. I'll try to fix that soon.";
} else {
echo "<h3>Message received. Give me a day or two to reply. Thank you!</h3>";
}

include('footer.html');

?>

+ 1
- 0
src/theme/footer.html View File

@@ -0,0 +1 @@
</div><br></div>

+ 1
- 0
src/theme/header.html View File

@@ -0,0 +1 @@
<!DOCTYPE html><title>Orange Hat Tech</title><link rel=icon href=favicon.ico><meta charset=UTF-8><style>a{color:#fd6500}body{background-color:#248}div{margin:auto;border-radius:40px;border:4px solid #fd6500}h1{color:#fb9;text-align:center;min-height:85px}</style><div style=background-color:#444;max-width:800px;><svg style=padding:1%;float:left;height:113px viewbox="0 0 3162 2160"><defs><linearGradient id="A" x1="392.951" x2="386.098" y1="330.168" y2="363.391"/><linearGradient id="B" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="C" x1="320.775" x2="306.92" y1="335.323" y2="398.788"/></defs><g transform="translate(-1716.6 -3062.3) scale(8.87678)"><g fill-rule="evenodd"><path d="M256.6 439.4c2.2-9.7 4.4-76.6 24-75.5 69.9 2.1 140.8-74.3 193.2 86.6 28.4 5.9 49.5 22.5 60.5 34.4 52.8 57-70.3 105-176 100.5-126.4-5.3-234.2-96.3-101.6-146z" fill="#f60"/><path d="M255.9 439.7c-57.2 21.6-69 51-54 77.7 9.4-21.2 32-39.3 64.6-50.7a41.1 41.1 0 0 1-10.7-26.7v-.3zm216.6 7a42 42 0 0 1-12.8 22c43 12.4 76.5 31.8 84.8 55.3 5-12.1 2.5-25.3-10.2-39a117.9 117.9 0 0 0-60.5-34.5l-1.3-3.7z" fill="#a74100"/><path d="M470 444.1l-.9 3.6c-.5 2.4-2.8 5.4-7 8.4-4 3-9.9 6-17 8.8a223.2 223.2 0 0 1-55.7 12.4c-26.8 2.8-57.4 2.2-84.6-8.1a120.8 120.8 0 0 1-45.7-28.9l-2-1.2h-1.9l-.6-1.3c-.6 1.9-2.5 13.9-3 21.3-.5 6.8-.5 10.9-.2 14.7l.5.9.2.2c5.2 9.1 24 20.7 42.2 28.3 14.1 6 34.8 8.7 59.2 10a248 248 0 0 0 71-6.7c21.3-5 38.8-12.9 48-24.8l.1-.3 3.6-4.8s1.1-3.8 1.1-8.8c0-8-.3-15.7-5-20.9z"/></g><path d="M284.8 463.2s-3.3 7.4-5 17.7-.2 13.7-.2 13.7c4.5 2.5 9.4 4.8 14.2 6.8 13 5.4 34.5 8.6 56.7 9.8 0 0 .9-4 2.3-14 1.5-9.9-.1-16.7-.1-16.7a139.8 139.8 0 0 1-68-17.3z" fill="#585858" fill-opacity=".6"/><path d="M298.2 363.4c4.7 0 18.8 1.8 38 11.8 24 12.5 24.9 16.6 56.7 18.9 0 0 10.2.8 16.7-5.7 6.4-6.4 3.2-19.3-18.3-21-21.5-1.9-34-6.5-53.7-5.4l-44 2.1 6.4-.4" fill="#781f1c" fill-opacity=".5"/><path d="M383.9 345c-34.1-1.3-69.3 17.3-103.2 16.3-3.1-.2-6 1-8.4 3.2a26 26 0 0 0-5.8 8.2c-3.1 6.7-5.3 15.4-7 24.4-1.6 9-2.7 18.3-3.6 26-.7 7-1.2 12.1-1.7 14.5-32.5 12.4-50.9 27.4-57.8 43.8-7 16.6-1.5 34 12 49.4 27 30.5 86 54.5 149.7 57.2 53.3 2.3 110.8-8.6 148.8-27.4 19-9.4 33.2-20.8 39.4-34.2 6.2-13.3 3.6-28.5-10-43.2a120.6 120.6 0 0 0-60.5-35c-13-39.5-27.2-65-42.6-80.6A70 70 0 0 0 384 345zm-.2 5.3c16 .6 31 5.9 45.8 21 14.6 15 28.8 40 41.8 80a2.6 2.6 0 0 0 2 1.7 115.5 115.5 0 0 1 59.1 33.7c12.7 13.8 14.5 26 9.2 37.5-5.4 11.6-18.7 22.5-37 31.7-36.9 18.2-93.8 29.1-146.3 26.9-62.5-2.7-120.6-26.8-146-55.5-12.7-14.4-17.2-29.3-11-43.9 6-14.5 23.5-29.2 56.3-41.5a2.6 2.6 0 0 0 1.6-2.4c.7-3 1.2-8.5 2-15.8.8-7.6 1.9-16.8 3.5-25.6a98.3 98.3 0 0 1 6.6-23.1c1.4-3 3-5.2 4.5-6.6 1.6-1.4 3-2 4.7-2 36 1.2 71.2-17.3 103.2-16.1z" fill-rule="evenodd"/><ellipse cx="299.9" cy="372.9" rx="26.5" ry="11.9" fill="#f60"/><path d="M294.6 358.2c-4.7 0-11.4-.1-16.6 2.5-4.9 2.4-7.7 5.9-7.7 5.9-2.2 2.7 2 6 4.1 3.3 0 0 2.1-2.6 5.9-4.5a38 38 0 0 1 14.3-2c4 0 18 1.7 36.8 11.5 23.8 12.4 25.7 16.9 57.7 19.2 3.6.4 3.2-.6-.4-.8-28-2.3-32.1-7-55-21.5a75.2 75.2 0 0 0-39-13.6z"/><path d="M362.8 403.3c-9.8 2.7-11.9 4.7-30.2 4.7-18.4 0-50.9-21.8-50.9-31.9s21.7-9.7 37.3 0c43.8 27.2 55.7 23.8 43.8 27.2z" fill="url(#C)"/><path d="M383.3 352.4c-14.1 0-20.6.4-27.8 5.9 12.7-1.6 19.5.2 33.8 3.8 16.9 4.2 27.7 7.3 37.4 12.4-3.4-8.7-21-19.3-36.2-21.6-2.4-.4-4.8-.5-7.2-.5z" fill="url(#A)"/></g></svg><h1>Orange Hat Tech</h1><div style=background-color:#000;color:#fff;width:85%;padding:3%>

Loading…
Cancel
Save