Skip to content

Instantly share code, notes, and snippets.

View LiamKarlMitchell's full-sized avatar

Liam Mitchell LiamKarlMitchell

View GitHub Profile
@LiamKarlMitchell
LiamKarlMitchell / style.css
Last active October 29, 2017 22:53
Drunk Stack Overflow - Drunk CSS
@keyframes rotating-function {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(2deg);
filter: blur(1px);
}
50% {
transform: rotate(0deg);
@LiamKarlMitchell
LiamKarlMitchell / jsreport licensing audit
Created November 16, 2017 14:59
A breif investigation into the security and suitability of jsreport.
JSReport, brief licensing audit.
In order to verify if JSReport is suitable for our needs one thing we must check is the licensing because it uses a remote server.
A license key is checked by a remote server, as such we must understand the behavior.
We can't have the software leaking any private information from the report templates/data therein.
The implementation does a post to an https URL.
License verification URL: https://jsreportonline.net/license-key
@LiamKarlMitchell
LiamKarlMitchell / jsreport audit.md
Last active November 16, 2017 16:50
A breif investigation into the security and suitability of jsreport.

JSReport, brief audit.

In order to verify if JSReport is suitable for our needs one thing we must check is the licensing because it uses a remote server.

jsreport can be run on our own servers.

Licensing

We may be able to use a free license during development. If we grow beyond 5 report templates we will need to subscribe for a yearly enterprise license.

@LiamKarlMitchell
LiamKarlMitchell / checkbox.js
Last active November 17, 2017 20:58
Helpful Handlebars template helpers.
// Show an HTML encoded checkbox for the result of a boolean like value.
Handlebars.registerHelper('checkbox', function (obj) {
return new Handlebars.SafeString(obj==true ? '☑' : '☐')
})
@LiamKarlMitchell
LiamKarlMitchell / BindProperty.cs
Last active December 6, 2017 02:30
C# Datagrid bind nested properties from data source.
// I can't take credit for this but I wanted it as a Gist so I could find it in the future easily if needed.
// Found on a blog post by Antonio Bello
// http://www.developer-corner.com/blog/2007/07/19/datagridview-how-to-bind-nested-objects/
/// <summary>
/// A custom property binder.
/// </summary>
/// <param name="property"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
@LiamKarlMitchell
LiamKarlMitchell / HideVirtualBox.bat
Created February 3, 2018 12:11
Hide Virtual Machine.
@echo off
@reg copy HKLM\HARDWARE\ACPI\DSDT\VBOX__ HKLM\HARDWARE\ACPI\DSDT\NOBOX__ /s /f
@reg delete HKLM\HARDWARE\ACPI\DSDT\VBOX__ /f
@reg add HKLM\HARDWARE\DESCRIPTION\System /v SystemBiosVersion /t REG_MULTI_SZ /d "NOBOX - 1" /f
@reg add HKLM\HARDWARE\DESCRIPTION\System /v VideoBiosVersion /t REG_MULTI_SZ /d "NOBOX - 1" /f
@taskkill /f /im VBoxTray.exe
@exit
@LiamKarlMitchell
LiamKarlMitchell / D3DFORMAT.h
Created February 10, 2018 03:53
DirectX 9 D3D Header structs/info
typedef enum _D3DFORMAT
{
D3DFMT_UNKNOWN = 0,
D3DFMT_R8G8B8 = 20,
D3DFMT_A8R8G8B8 = 21,
D3DFMT_X8R8G8B8 = 22,
D3DFMT_R5G6B5 = 23,
D3DFMT_X1R5G5B5 = 24,
D3DFMT_A1R5G5B5 = 25,
@LiamKarlMitchell
LiamKarlMitchell / item_category_query.sql
Last active March 24, 2018 09:59
rathena useful queries
WITH monster_drops
AS
(
SELECT id as monster_id, MVP1id AS item_id, MVP1per AS item_rate FROM mob_db
UNION
SELECT id as monster_id, MVP2id AS item_id, MVP2per AS item_rate FROM mob_db
UNION
SELECT id as monster_id, MVP3id AS item_id, MVP3per AS item_rate FROM mob_db
UNION
SELECT id as monster_id, Drop1id AS item_id, Drop1per AS item_rate FROM mob_db
@LiamKarlMitchell
LiamKarlMitchell / DISK IOTimeout.reg
Created June 9, 2018 01:18
Windows registry tweaks.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk]
"TimeOutValue"=dword:00000019
"IoTimeoutValue"=dword:00000014
@LiamKarlMitchell
LiamKarlMitchell / hibernate.cfg.xml
Created June 19, 2018 23:50
Useful Hibernate Java things
Prevent locking up forever if trying to connect when db is not available.
Set the c3p0.checkoutTime to something other than 0 so that it stops trying to connect at some point.
<property name="hibernate.c3p0.acquireRetryAttempts">2</property>
<property name="hibernate.c3p0.acquireRetryDelay">10</property>
<property name="hibernate.c3p0.checkoutTimeout">1000</property>
<property name="show_sql">false</property>