Skip to content

Instantly share code, notes, and snippets.

View timabell's full-sized avatar
🍵
418 I'm a teapot

Tim Abell timabell

🍵
418 I'm a teapot
View GitHub Profile
--------- beginning of crash
E/AndroidRuntime( 3617): FATAL EXCEPTION: AsyncHandler
E/AndroidRuntime( 3617): Process: com.android.deskclock, PID: 3617
E/AndroidRuntime( 3617): android.database.sqlite.SQLiteException: Can't downgrade database from version 11 to 7
E/AndroidRuntime( 3617): at android.database.sqlite.SQLiteOpenHelper.onDowngrade(SQLiteOpenHelper.java:360)
E/AndroidRuntime( 3617): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:254)
E/AndroidRuntime( 3617): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
E/AndroidRuntime( 3617): at com.android.deskclock.provider.ClockProvider.query(Unknown Source)
E/AndroidRuntime( 3617): at android.content.ContentProvider.query(ContentProvider.java:1000)
E/AndroidRuntime( 3617): at android.content.ContentProvider$Transport.query(ContentProvider.java:214)
#!/bin/bash
#
# Compare two PDF files.
# Dependencies:
# - pdfinfo (xpdf)
# - pdfjam (texlive-extra-utils)
# - diffpdf
#
MAX_HEIGHT=15840 #The maximum height of a page (in points), limited by pdfjam.
@timabell
timabell / azure-boxstarter.txt
Last active November 19, 2015 15:56
boxstarter for an azure vm that already had vs2015 on it
# boxstarter script http://boxstarter.org/
# source: https://gist.github.com/timabell/e1d9def6ca38d9ebee5c
# based on: https://gist.github.com/timabell/608fb680bfc920f372ac
# originally tested on win7 x64
# wip on win 8.1 build
# To run, paste this into internet explorer's address bar (doen't work in firefox) and hit enter:
# http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/timabell/e1d9def6ca38d9ebee5c/raw/azure-boxstarter.txt
# If IE is your default browser you can simply paste into start > run without firing up IE first.
@timabell
timabell / sourced.ai spam.md
Last active December 8, 2016 15:57
unsolicited mail by farming my OSS publications. douchebags.

completely irrelevant, if they'd bothered to actually look they'd have known that. reading github doesn't make your automated spam bullshit any more acceptable. wankers.

Oh and pick one domain and stick to it ffs. Idiots. Which is it, http://sourced.ai/ or http://sourced.tech/

I don't mind people (humans) reading my published stuff and contacting my personally, but the below is unacceptable.

From your webshite:

We send highly relevant job proposals to the suggested profiles and inform them about all the aspects of the position.

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\SshHostKeys]
"rsa2@22:github.com"="0x23,0xab603b8511a67679bdb540db3bd2034b004ae936d06be3d760f08fcbaadb4eb4edc3b3c791c70aae9a74c95869e4774421c2abea92e554305f38b5fd414b3208e574c337e320936518462c7652c98b31e16e7da6523bd200742a6444d83fcd5e1732d03673c7b7811555487b55f0c4494f3829ece60f94255a95cb9af537d7fc8c7fe49ef318474ef2920992052265b0a06ea66d4a167fd9f3a48a1a4a307ec1eaaa5149a969a6ac5d56a5ef627e517d81fb644f5b745c4f478ecd082a9492f744aad326f76c8c4dc9100bc6ab79461d2657cb6f06dec92e6b64a6562ff0e32084ea06ce0ea9d35a583bfb00bad38c9d19703c549892e5aa78dc95e250514069"
"rsa2@22:gist.github.com"="0x23,0xab603b8511a67679bdb540db3bd2034b004ae936d06be3d760f08fcbaadb4eb4edc3b3c791c70aae9a74c95869e4774421c2abea92e554305f38b5fd414b3208e574c337e320936518462c7652c98b31e16e7da6523bd200742a6444d83fcd5e1732d03673c7b7811555487b55f0c4494f3829ece60f94255a95cb9af537d7fc8c7fe49ef318474ef2920992052265b0a06ea66d4a167fd9f3a48a1a4a307ec1eaaa5149a969a6ac5d56a5ef627e51
declare @prefix varchar = 'MyApp_'
select
tbl.name [table],
col.name [column],
ep.name,
ep.value [value]
from sys.extended_properties ep
inner join sys.objects tbl on tbl.object_id = ep.major_id
left outer join sys.columns col on col.object_id = ep.major_id and col.column_id = ep.minor_id
where ep.name like @prefix + '%'
@timabell
timabell / cull-remote-branches.sh
Last active July 16, 2016 07:54
delete all but the specified branches on the remote, useful after a github fork of a repo with many branches you don't care about
git branch -r |grep timabell| egrep -v "master|gh-pages|things|to|leave"| sed 's/.*\// :/'|xargs git push timabell
// method to add to dbcontext
/// <summary>
/// Set EF's OriginalValue of RowVersion for 'entity' to the supplied value.
/// This allows you to make use of EF's built-in concurrent-editing
/// when you don't have the entity as it was presented to the user to
/// edit (because of the stateless nature of the web).
/// Call this before SaveChanges to ensure concurrent edits don't go
/// unnoticed by users.
/// More info: http://stackoverflow.com/a/9190378/10245
@timabell
timabell / extended_attributes.sql
Created October 6, 2016 09:35
source-controllable self-enforcing extended attribute list for sql server
-- Permanent copy of schema extended properties
-- In a format suitable for easy source control and hand-editing.
-- All the properties are prefixed and only those will be added/updated/deleted by this script
-- At the bottom you'll find a commented-out `select` for generating the
-- insert block from an existing schema's extended properties.
@timabell
timabell / sql layout example.sql
Last active October 26, 2016 11:21
laying out sql nicely with vim tabularize - https://www.flickr.com/photos/tim_abell/30278239000/
-- Before. Note the tab characters in between the "columns" that we want in the sql text.
-- The tabs have been manually added to tell vim where we want to line things up
-- `:set list` to see tabs in vim
create table HandCraftedSqlTable (
id int identity (1, 1) not null,
parentid int not null,
somename varchar(10) not null,
someothername varchar(65) not null,
somestatus int not null constraint DF_table_tabletatusID default (1),
somereallylongcolumnname varchar(255) null,