Skip to content

Instantly share code, notes, and snippets.

Matúš Koprda bladeSk

Block or report user

Report or block bladeSk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bladeSk /
Last active Nov 29, 2019
Deploying Laravel on a shared hosting using only .htaccess

Deploying Laravel on a shared hosting using only .htaccess

Making Laravel work on a shared hosting can be troublesome, because Laravel needs to have its document root set to the public directory. This may not be configurable by a user or even desirable, when the server is hosting multiple websites.

Here's a simple method using only a .htaccess file placed in Laravel's root directory - e.g. alongside app, bootstrap, config, ... No changes whatsoever are necessary to your code.

The file rewrites all the requests so that requesting /file.png would in fact return /public/file.png and anything else is routed to /public/index.php. This also ensures that nothing outside the public folder can be accessed, thereby protecting any sensitive files like .env or database/*.

The simple method

bladeSk / SQLite-PHP-quickstart.php
Last active Dec 9, 2019
SQLite3 PHP Quickstart Tutorial
View SQLite-PHP-quickstart.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);
bladeSk / mouse cursor follows focus.ahk
Last active Jan 18, 2019
AutoHotKey: Make mouse cursor follow window focus
View mouse cursor follows focus.ahk
; Makes the mouse cursor follow window focus, but ONLY if the focus change
; wasn't caused by the mouse - e.g. Alt-Tab, Win+<Number>, hotkeys, ...
; Saves a lot of mousing around on multi-monitor setups!
Gui +LastFound
lastMouseClickTime := 0
hWnd := WinExist()
DllCall("RegisterShellHookWindow", UInt, hWnd)
bladeSk / index.html
Last active Aug 1, 2016
Basic WebGL example
View index.html
<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>basic webgl example</title>
body { margin: 0; }
canvas { display: block; }
You can’t perform that action at this time.