Skip to content

Instantly share code, notes, and snippets.

View jamesmanning's full-sized avatar

James Manning jamesmanning

View GitHub Profile
This file has been truncated, but you can view the full file.
var berryEmotes=[{"background-image":"http://a.thumbs.redditmedia.com/-UJ20dLxrm_8r4kr.png","tags":["lyra"],"sr":"marmemotes","height":140,"width":126,"names":["welliwashungryandwhenyoucravehands"],"apng_url":"http://backstage.berrytube.tv/marminator/images/a/-UJ20dLxrm_8r4kr.png"},{"background-image":"http://a.thumbs.redditmedia.com/1ERLWojxsUO7nFQT.png","tags":["luna",""],"sr":"marmemotes","height":140,"width":121,"names":["doodoodooluna"],"apng_url":"http://backstage.berrytube.tv/marminator/images/a/1ERLWojxsUO7nFQT.png"},{"background-image":"http://a.thumbs.redditmedia.com/84ozl2WMmiYp6Euf.png","tags":["oc",""],"sr":"marmemotes","height":140,"width":200,"names":["ivyrage","ierage"],"apng_url":"http://backstage.berrytube.tv/marminator/images/a/84ozl2WMmiYp6Euf.png"},{"background-image":"http://a.thumbs.redditmedia.com/E1FnMA0PMGL9qnwx.png","tags":["oc","berrytube"],"sr":"marmemotes","height":140,"width":118,"names":["keystrokeguitar"],"apng_url":"http://backstage.berrytube.tv/marminator/images/a/E1FnMA0PMG
@jamesmanning
jamesmanning / Program.cs
Created April 19, 2013 19:03
using exception.ToString - sync code
using System;
using System.IO;
using System.Threading;
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
WebPiCmd Information: 0 :
DateTime=2013-02-12T19:08:58.1431473Z
WebPiCmd Warning: 0 : The software that you obtain using the Web Plaform Installer Command Line Tool is licensed to you by its owner. Microsoft grants you no rights for third party software.
DateTime=2013-02-12T19:08:58.1451474Z
WebPiCmd Verbose: 0 : Executing command: "C:\Program Files\Microsoft\Web Platform Installer\WebpiCmd.exe" /Install /AcceptEula "/Products:Workflow Manager Tools 1.0 for Visual Studio 2012" /log:c:\temp\wf-log.txt
DateTime=2013-02-12T19:08:58.1551480Z
WebPiCmd Information: 0 : Successfully loaded primary feed: https://go.microsoft.com/?linkid=9819333
DateTime=2013-02-12T19:08:59.2692117Z
WebPiCmd Start: 0 : The following software is going to be installed:
DateTime=2013-02-12T19:08:59.6282323Z
DownloadManager Information: 0 : Loading product xml from: https://go.microsoft.com/?linkid=9819333
DownloadManager Information: 0 : https://go.microsoft.com/?linkid=9819333 responded with 302
DownloadManager Information: 0 : Response headers:
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 174
Content-Type: text/html; charset=utf-8
Expires: Tue, 05 Feb 2013 19:07:06 GMT
Location: http://www.microsoft.com/web/webpi/4.2/webproductlist.xml
Server: Microsoft-IIS/7.5
using System;
using System.Linq;
using Ninject;
using Ninject.Extensions.Factory;
namespace SomeRootNamespace
{
class Program
{
static void Main(string[] args)
@jamesmanning
jamesmanning / Program.cs
Created January 16, 2013 18:48
example of how *not* to do namespace-based factory binding with ninject
using System;
using System.Linq;
using Ninject;
using Ninject.Extensions.Factory;
namespace SomeRootNamespace
{
class Program
{
static void Main(string[] args)
@jamesmanning
jamesmanning / GenerateAlterColumnNotNullStatements.linq.cs
Created December 27, 2012 21:23
LINQPad script to generate the set of possible 'alter table alter column not null' statements for the nullable columns in a database
void Main()
{
var databaseInfo = GetDatabaseInfo(this);
// databaseInfo.Dump();
foreach (var table in databaseInfo.Tables)
{
var nullableColumns =
from c in table.Columns
where c.DatabaseType.EndsWith(" NOT NULL") == false
@jamesmanning
jamesmanning / GetDatabaseInfo.linq.cs
Last active January 15, 2024 03:54
LINQPad script to get basic schema information about the currently selected database (assumes LINQPad's default data context creation method)
void Main()
{
var databaseInfo = GetDatabaseInfo(this);
databaseInfo.Dump();
}
// Define other methods and classes here
public class DatabaseInfo
{
public Type DataContextType { get; set; }
@jamesmanning
jamesmanning / sp_generate_inserts2.sql
Created June 22, 2012 18:14
slightly better version of sp_generate_inserts
SET NOCOUNT ON
GO
PRINT 'Using Master database'
USE master
GO
PRINT 'Checking for the existence of this procedure'
IF (SELECT OBJECT_ID('sp_generate_inserts','P')) IS NOT NULL --means, the procedure already exists
BEGIN
@jamesmanning
jamesmanning / RemoveDeadTracks.ps1
Created June 9, 2012 17:03
PowerShell script to remove dead entries from the iTunes library
# get reference to the running iTunes
$itunes = New-Object -ComObject iTunes.application
# get all tracks in the entire library
$allTracks = $itunes.LibraryPlaylist.Tracks
# find the entries that are no longer on disk
# NOTE: the API returns the location as null for those, so we check for
# that instead of doing our own filtering based on test-path or similar
$deadEntries = $allTracks | ?{ $_.Location -eq $null }