Skip to content

Instantly share code, notes, and snippets.

@factormystic
factormystic / profile.ps1
Created May 19, 2016 01:29
my custom powershell prompt
# open your profile.ps1 and paste this in
# easiest way:
# > youreditorprogram.exe $profile
function Prompt {
$path = $(Get-Location).Path
if ($path.StartsWith($HOME, "CurrentCultureIgnoreCase")) {
$path = "~"+ $path.Substring($HOME.Length)
}
@factormystic
factormystic / form.cs
Last active October 31, 2015 00:50 — forked from Ell/form.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
@factormystic
factormystic / .gitconfig
Created August 31, 2015 21:49
git behind/ahead aliases
[alias]
behind = log HEAD~1..@{u} --decorate --oneline
ahead = log @{u}..HEAD --decorate --oneline
@factormystic
factormystic / MainPage.xaml.cs
Created June 20, 2014 01:05
example of akavache + dynamic
using Akavache;
using Microsoft.Phone.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
namespace akavache_dynamic_deserialization_3
{
everything i write on medium is plausible to someone
xoxo j$
@factormystic
factormystic / output.txt
Created January 22, 2014 00:55
Listening on http in c# without a uac prompt
c:\>curl http://localhost:65432/wat/
Hiya mister curl/7.26.0
c:\>
using System;
using System.Collections.Generic;
namespace FMUtils.FlexTreeView.Extensions
{
public static class IEnumerableExtensions
{
public static IEnumerable<T> Realize<T>(this IEnumerable<T> source, Action<T> action)
{
foreach (T el in source)
@echo off
REM Usage: `up <n>`
REM Will run `cd ..` n times
REM Put this file (`up.bat`) somewhere in your PATH
set many=1
if not "%1"=="" set many=%1
for /l %%x in (1, 1, %many%) do cd ..
var size = {
width: 650,
padding: 60,
radius: 250,
};
// scale from unit positions to pixel positions
var scale = {
pixel: d3.scale.linear()
.domain([-1, 0, 1])