Skip to content

Instantly share code, notes, and snippets.

@distantcam
distantcam / drawarc.c
Created April 28, 2013 15:30
Pebble helper functions
/*
Copyright 2013 Cameron MacFarland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@distantcam
distantcam / CUI.cs
Last active February 14, 2017 04:54
CUI - A simple Console UI
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static System.Console;
using static System.ConsoleColor;
namespace CUI
{
public class ConsoleApplication<TScreen>
using System.ComponentModel;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Exporters;
using BenchmarkDotNet.Running;
[MemoryDiagnoser]
[MarkdownExporter]
public class PropertyChangedArgBenchmarks
{
@distantcam
distantcam / SimpleConfig.cs
Created October 12, 2017 08:57
Simple config class
public static class SimpleConfig
{
static string configFilePath;
public static void InitializeInLocalApplicationData(string name)
{
Initialize(Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
name,
"config.xml"
@distantcam
distantcam / Sample.csproj
Created October 19, 2017 03:27
Example new project
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net462</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DebugType>full</DebugType>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
using Unity.Entities;
using Unity.Jobs;
public abstract class CompositeParallelJobSystem<T1, T2> : JobComponentSystem
where T1 : struct, IJobParallelFor
where T2 : struct, IJobParallelFor
{
protected ComponentGroup group;
protected abstract ComponentGroup CreateGroup();
public static class AkavacheExtensions
{
public static IObservable<string> GetOrFetchWithETag(this IBlobCache cache, string url)
{
var result =
// Get from cache
cache.GetObject<string>(url)
// Cached values are true
.Select(x => Tuple.Create(x, true))
@distantcam
distantcam / xkcd.fx
Created October 9, 2012 09:45
xkcd Shader
sampler2D input : register(s0);
/// <summary>The second input texture.</summary>
/// <defaultValue>c:\examplefolder\examplefile.jpg</defaultValue>
sampler2D RandomTexture : register(s1);
/// <summary>The radius of the Poisson disk (in pixels).</summary>
/// <minValue>1</minValue>
/// <maxValue>10</maxValue>
/// <defaultValue>5</defaultValue>
@distantcam
distantcam / extensions.json
Created March 28, 2019 07:15
Presentation settings for vscode
{
"recommendations": [
"saviorisdead.theme-githubcleanwhite",
"evilz.vscode-reveal"
]
}
0eNrtnU1vJEeSpv9Kg5e9FIXwb3cdp08L7GkwhwEWi0aVRGiILlUVWCxhGg3+92UmM1mpTLOI94nM1GgGvHRDVOQjD3cLd3Nzc3v/efPh47e7Lw/3nx7/9uHz57/f/PjP73/5evPj/z34x82/+/rp/Zfbx8+3vzzc/7z55/+8+TFM07ubf2z//+ndzfsPXz9//PZ4d7t58sv9p19ufnx8+Hb37ub+p8+fXoBf73/59P7j5teP//hyd/PjzW/3D4/fnv/y7ubT+183f3h54vZ/3zwD7z/9fLf5rzy9M355/3j36/efPby//3jwk8h/kpSffP7w+cvnh8eDn+Wn//fu5u7T4/3j/d3LO27/4R9/+/Tt1w93D8+t//5qv77/+PH24/tfvzwTv3z++vyTz592PXmbfyjbrrytP5SnTVOOMFHCLFGSRBllAZMlTJiWmlO0vql7TLYx9RXz4f6X27uPdz89Ptz/dPvl88c7g7ZjlecxfLbLT88P32/N8583YfM/D3c/Hw7jxtbbwX9z889x2gz6Lw93d5+UR5+sNjfSZt7ketSOMB03LLjvIP3WfKkujefScA6JktICJkyki9P5ZhGSbBabR80eDNp0kZb6MGjzRV3sxEQ6sfJOPDGuUN1eNJ+1u1GboepiN2oz1FjsRjRFjRXdmI675mQmGn6/Sj+2OxrNY2Fa8WbH01HyZ1/zWbvdXVzCFi1ksDXMwcRpxRp2xnoQw9EfSpbXA/O3Zi/HwFc58FLxeD44Mdt83NLivuU6mP3aEa2Dnkkktg56mLxiGSSDcGwN0Z/AzWftLixsHfRevq5YvsjLZ32WNZ+1X76x1ct7+c4WLw8zVqxdpA/r6ap+MosffXkzvbyOZo5DmtYsbuTVx9LCW/3FTvux/WIBrn6OaaTINrferjShza1HyWxz62EK3Nx6nHoaNjihxBdEtAlNILRZQicGvJkvNqhuotAs0OIMKk+/i8Hc7oIup+M9dj2cwg+bj+rn+4eXb2oX3znGwkjLZuE0m8d