Skip to content

Instantly share code, notes, and snippets.

View propagated's full-sized avatar

Peter Williams propagated

View GitHub Profile
{
"basics": {
"name": "Petey Williams",
"label": "Architect",
"picture": "",
"email": "pete@propagatesoftware.com",
"phone": "(203)6799309",
"website": "http://propagatesoftware.com",
"summary": "Bird up",
"location": {
@propagated
propagated / soundcloudEmbedVolumeFix.js
Last active May 8, 2023 04:52
control soundcloud embed volume
//load soundcloud js api if needed
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://w.soundcloud.com/player/api.js';
document.head.appendChild(script);
//get the id of the player iframe or inject it using chrome
var id = 'scplayer',
widgetIframe = document.getElementById(id),
fixWidget = SC.Widget(widgetIframe);
@propagated
propagated / InhertitanceInjection
Last active May 2, 2017 20:47
Basic inheritance model for injected objects
namespace example
{
class Product
{
public string ProductName { get; set; }
public string Text { get; set; }
}
class FileXChange : Product
static void Log(string message, string path = "LOG.txt")
{
Console.WriteLine(message);
using (System.IO.FileStream sw = new System.IO.FileStream(path, System.IO.FileMode.Append))
{
using (System.IO.StreamWriter sw2 = new System.IO.StreamWriter(sw))
{
sw2.WriteLine(message);
}
}
@propagated
propagated / EnumList.cs
Created August 15, 2014 18:34
Extension method for List<String> that takes an IEnumerable collection and initalizes the list with what it returns
//TODO: this
@propagated
propagated / UnitTests.cs
Last active August 29, 2015 14:04
Template for NUnit Class
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
namespace SomeNamespace.UnitTests
{
internal static class UnitTestSetup