Skip to content

Instantly share code, notes, and snippets.

View XaeroDegreaz's full-sized avatar

Jerome Doby XaeroDegreaz

View GitHub Profile
@XaeroDegreaz
XaeroDegreaz / JavaScriptParser.java
Last active October 16, 2016 09:51
Take query parameters (and headers, etc) from HTTP request and create JavaScript objects from them to be used in a provided JavaScript template
package com.dobydigital.supermock.parsing;
import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.util.Map;
import java.util.Set;
@XaeroDegreaz
XaeroDegreaz / Dump.java
Created March 5, 2016 07:20
Small example of JPA entities
package com.dobydigital.jsondb.models;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonMethod;
import org.codehaus.jackson.annotate.JsonProperty;
import org.eclipse.persistence.annotations.CacheIndex;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.NamedQuery;
@XaeroDegreaz
XaeroDegreaz / bookOfMonsters.obj
Created February 9, 2016 05:23
Book of Monsters
# Blender v2.70 (sub 0) OBJ File: 'book.blend'
# www.blender.org
mtllib book.mtl
o Cube
v 1.446141 -0.436274 -1.952967
v 1.446141 -0.436274 1.952967
v -1.486355 -0.415975 1.952966
v -1.486355 -0.415975 -1.952967
v 1.445009 0.430482 -1.952678
v 1.445007 0.430482 1.952680
@XaeroDegreaz
XaeroDegreaz / oldOpenBook.obj
Created February 9, 2016 04:51
Old Open Book Blender Model
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 30.05.2014 20:29:43
mtllib book.mtl
#
# object polySurface1
#
v 0.5601 -0.0084 -0.9401
@XaeroDegreaz
XaeroDegreaz / CascadeDeleting.java
Last active August 29, 2015 14:07
Initial workings of a system to facilitate cascade deleting for MySQL
/* The annotation thus far */
@Retention( RetentionPolicy.RUNTIME )
public @interface OnDeleteCascade
{
String foreignKeyName();
String foreignKeyColumn();
String referencedForeignColumn();
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace GithubWikiDoc
{
--- C:/Users/Xaero/Desktop/dfControl.cs Thu Mar 06 14:01:35 2014
+++ C:/Users/Xaero/Desktop/dfControlModified.cs Tue Mar 25 08:27:23 2014
@@ -175,6 +175,11 @@
public event PropertyChangedEventHandler<bool> ControlHidden;
/// <summary>
+ /// Occurs when the control is clipped / unclipped by the parent's clipping rectangle.
+ /// </summary>
+ public event PropertyChangedEventHandler<bool> ControlClippingChanged;
+
@XaeroDegreaz
XaeroDegreaz / doops.sql
Created December 4, 2013 01:01
Delete dupes.
DELETE A.* FROM
(
SELECT post_parse.phone_number, post_parse.address1
FROM post_parse INNER JOIN
(
SELECT Q.phone_number, Q.address1
FROM post_parse AS Q
GROUP BY Q.phone_number, Q.address1
HAVING Count(Q.*) > 1
)
@XaeroDegreaz
XaeroDegreaz / SmartRSS.php
Last active April 29, 2018 21:02
One RSS feed to rule them all =)
<?php
/*
* Copy this to your localhost, or some server.
* Add the shows you want into the array, then feed uTorrent
* the URL to this script so it can pull all of your torrents.
* I haven't accounted for any error checking, so if the ezrss server is down, or has an issue
* during one of the iterations below, it can break the XML, so you may have
* to refresh a couple times ;)
*/
Rect lRect = scrollPanel.GetScreenRect();
Rect cRect = panel.GetScreenRect();
Vector2 gVect = new Vector2( cRect.x, cRect.y );
//# Account for max off-screen tiles above visible list box rectangle.
lRect.y -= cRect.height * maxOffScreenTiles;
//# Account for max off-screen tiles below visible list box rectangle. We *2 to account for the decremented y above.
lRect.height += ( cRect.height * maxOffScreenTiles ) * 2;
if ( !lRect.Contains( gVect ) ) {