Skip to content

Instantly share code, notes, and snippets.

View findel's full-sized avatar

Phil Baines findel

View GitHub Profile
@findel
findel / qr-my-html-selection.js
Last active December 14, 2015 14:18
Bookmarklets to give you a QR code for selected HTML or text. Copy each to a bookmark.
javascript:
var html = "";
if (typeof window.getSelection != "undefined") {
var sel = window.getSelection();
if (sel.rangeCount) {
var container = document.createElement("div");
for (var i = 0, len = sel.rangeCount; i < len; ++i) {
container.appendChild(sel.getRangeAt(i).cloneContents());
}
html = container.innerHTML;
@findel
findel / stacktrace.txt
Created March 5, 2012 19:27
Simple.Data.Mysql StackOverflow stack trace
Can not intercept exception. Debugged program can not be continued and properties can not be evaluated.
System.StackOverflowException
at Int32 System.Globalization.CompareInfo.GetHashCodeOfString(System.String source, System.Globalization.CompareOptions options)
at Int32 System.CultureAwareComparer.GetHashCode(System.String obj)
at Boolean System.Collections.Concurrent.ConcurrentDictionary`2[System.String,System.String].TryGetValue(System.String key, System.String value)
at String System.Collections.Concurrent.ConcurrentDictionary`2[System.String,System.String].GetOrAdd(System.String key, System.Func`2[System.String,System.String] valueFactory)
at static String Simple.Data.Extensions.HomogenizeEx.Homogenize(System.String source)
at Table Simple.Data.Ado.Schema.TableCollection.Find(System.String tableName)
at Table Simple.Data.Ado.Schema.DatabaseSchema.FindTable(System.String tableName)
at String Simple.Data.Ado.SimpleReferenceFormatter.TryFormatAsObjectReference(Simple.Data.ObjectRefer
@findel
findel / clearfix.css
Created February 23, 2012 17:20
Clearfix (the most up-to-date version, I think)
/* For modern browsers */
.clearfix:before,
.clearfix:after
{
content:"";
display:table;
}
.clearfix:after{ clear:both; }
/* For IE 6/7 (trigger hasLayout) */
@findel
findel / MyKind.cs
Created February 1, 2012 12:13
Looping through enumerator to bind to DropDownList
// My enumerator
public enum MyKind
{
None = 0,
MyFirstValue = 1,
MySecondValue = 2,
MyThirdValue = 3
}
// My extention methods for the enumerator