Skip to content

Instantly share code, notes, and snippets.

View gphg's full-sized avatar

Garett PHG gphg

  • NKRI
View GitHub Profile
@gphg
gphg / tags.csv
Last active May 28, 2019 13:04
Tsumino Tag Definitions (http://www.tsumino.com/Tags/Definitions). Retrieved 2019-05-28.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
"define"
"Age Progression"
"Age Regression"
"Ahegao"
"Alien"
"All the Way through"
"Amputee"
"Anal"
"Angel"
"Anilingus"

Keybase proof

I hereby claim:

  • I am gphg on github.
  • I am garett (https://keybase.io/garett) on keybase.
  • I have a public key ASC9o7ETRe6XwrtiPujpf1YlwIZxUBW-7Gc2Ju53i1WCUgo

To claim this, I am signing this object:

# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
# https://github.com/hashicorp/vagrant/issues/9442#issuecomment-374785457
unless Vagrant::DEFAULT_SERVER_URL.frozen?
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
@gphg
gphg / tasks.json
Last active June 5, 2020 10:32
VSCode tasks.json for C/C++ programming on Ming-w64. See comments for more detail.
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: g++.exe build active file",
"command": "${env:MSYS2_ROOT}\\mingw64\\bin\\g++.exe",
"args": [
"-g",
"${file}",
@gphg
gphg / PicoPageModPlugin.php
Last active July 13, 2020 01:53 — forked from PhrozenByte/PicoPageModPlugin.php
A simple Pico plugin adding a page's last modification time to its page data. Pico is a stupidly simple, blazing fast, flat file CMS. http://picocms.org/
<?php
/**
* Pico page modification time plugin
*
* Adds a page's last modification time to its page data.
*
* Example:
*
* ```twig
@gphg
gphg / HttpPageCaching.php
Last active July 15, 2020 06:38
A simple Pico CMS plugin for HTTP caching.
<?php
/**
* Pico HTTP page caching plugin
*
* Web server (well known are Apache2 and Nginx) come with
* mod_cache and mod_expires specialize for static files.
* Last-Modified HTTP header is part of it.
*
* This plugins gives more control on Pico http page caching.
@gphg
gphg / app.php
Last active July 24, 2020 21:07
Laravel/Lumen: load SQLite database relative path dynamically. Basically it check if database path IS NOT absolute, then reassign it with relative one.
<?php // bootstrap/app.php
// <=========== AFTER DOTENV LOEADED ================>
// Laravel/Lumen SQLite relative path
if ((getenv('DB_CONNECTION') === 'sqlite') // Check if BD driver is SQLite
&& (realpath(getenv('DB_DATABASE')) === false) // And database path IS NOT absolute
) { // Assign it to absolute with realpath() instead.
putenv("DB_DATABASE=".realpath(__DIR__.'/../' . getenv('DB_DATABASE')));
};
@gphg
gphg / w3.css
Created July 27, 2020 06:50
w3.css but without "w3-" prefix. Because why not? Information about w3.css can be found here: https://www.w3schools.com/w3css/default.asp
/* W3.CSS 4.13 June 2019 by Jan Egil and Borge Refsnes */
html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}
/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}
article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item}
audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline}
audio:not([controls]){display:none;height:0}[hidden],template{display:none}
a{background-color:transparent}a:active,a:hover{outline-width:0}
abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}
b,strong{font-weight:bolder}dfn{font-style:italic}mark{background:#ff0;color:#000}
@gphg
gphg / viewer.js
Last active August 19, 2020 07:05
Humble XMLHttpRequest image parser.
var IMAGE_PER_SET = 10;
function getParameterByName(name) {
var match = RegExp("[?&]" + name + "=([^&]*)").exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, " ").replace("\u200E", ""));
}
function makeRequest(method, url, done) {
var xhr = new XMLHttpRequest();
xhr.open(method, url);
xhr.onreadystatechange = function () {
@gphg
gphg / .htaccess
Created September 10, 2021 18:54
Fix nasty PHP FastCGI Error: No input file specified. Tested on XAMPP Windows and Debian with LAMP stack.
# Disable directory browsing
Options All -Indexes
# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>