Skip to content

Instantly share code, notes, and snippets.

View coldacid's full-sized avatar
🚩
CHECK YOUR DEPENDENCIES

Chris Charabaruk coldacid

🚩
CHECK YOUR DEPENDENCIES
View GitHub Profile
@coldacid
coldacid / AsyncCompletedEventArgs.cs
Created April 7, 2012 20:46
Generic AsyncCompletedEventArgs class for simple EAP async return values
namespace System.ComponentModel
{
public class AsyncCompletedEventArgs<T> : AsyncCompletedEventArgs
{
private T result;
public AsyncCompletedEventArgs(Exception error, bool cancelled, object userState)
: base(error, cancelled, userState)
{ }
@coldacid
coldacid / ScoreloopAsyncHelper.cs
Created December 22, 2012 03:12
Using the `async`/`await` keywords in C# makes it a lot easier to write asychronous code, which is very important for people working with Windows Phone or Windows 8. These keywords work with the Task Asynchronous Pattern (TAP) which is built around the `System.Threading.Tasks.Task` class, and which has an adaptor, `TaskCompletionSource<>`, for d…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Scoreloop.CoreSocial.API;
using Scoreloop.CoreSocial.API.Model;
using System.Threading.Tasks;
using ScoreloopGame = Scoreloop.CoreSocial.API.Model.Game;
@coldacid
coldacid / EnumEx.cs
Created January 3, 2013 07:19
GetNames and GetValues for enums in Silverlight. Includes cache of results to avoid wasting time in reflection later on.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Charabaruk.Utility
{
static class EnumEx
@coldacid
coldacid / RegisterServices.cs
Last active August 29, 2015 14:07
Common Service Locator adapter for TinyIoC
static void RegisterServices()
{
var container = TinyIoCContainer.Current;
ServiceLocator.SetLocatorProvider(() => new TinyIoCServiceLocator(container));
container.Register<ISettingsService>((c, o) => new CliOptionsSettingsService());
// ...
}
@coldacid
coldacid / after.SolutionName.sln.targets
Last active March 14, 2016 16:03
After-solution targets file for xUnit.net
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">.\</SolutionDir>
</PropertyGroup>
<PropertyGroup>
<xUnitPackageVersion>2.0.0-rc3-build2880</xUnitPackageVersion>
<PackageDir>$(SolutionDir)packages\xunit.runners.$(xUnitPackageVersion)\</PackageDir>
<NUnitXslFile>$(PackageDir)tools\NUnitXml.xslt</NUnitXslFile>
<TestResultFile>$(SolutionDir)TestResult.xml</TestResultFile>
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/rubygems/user_interaction.rb:687:in `initialize': Invalid argument @ rb_sysopen - /dev/null (Errno::EINVAL)
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/rubygems/user_interaction.rb:687:in `open'
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/rubygems/user_interaction.rb:687:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler/ui/rg_proxy.rb:9:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler.rb:100:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler.rb:100:in `ui='
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/bundler.rb:32:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/bundler.rb:18:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/bundler.rb:18:in `instance'
from C:/HashiCorp/Vagrant/embedd
@coldacid
coldacid / PivotCaesar.cs
Created August 5, 2016 15:32
Pivoting Caesar cipher
// Copyright (c) 2016 Christopher S. Charabaruk <chris.charabaruk%%outlook.com>
public class PivotCaesar
{
public static void Main(string[] args)
{
if (args[0] == "-d" || args[0] == "--decrypt")
{
foreach (var message in args.Skip(1))
{
Verifying that "coldacid.id" is my Blockstack ID. https://onename.com/coldacid
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2017-06-20T20:15:13.3116334</Date>
<Author>MACHINENAME\UserAccount</Author>
<URI>\Lock SSH Agent</URI>
</RegistrationInfo>
<Triggers>
<SessionStateChangeTrigger>
<Enabled>true</Enabled>