Skip to content

Instantly share code, notes, and snippets.

@jpoehls
jpoehls / ViewModelIndexer.cs
Created April 28, 2010 17:58
simple ViewModel locator
using System;
using System.ComponentModel.Composition;
using System.Collections.Generic;
using System.Linq;
namespace Samples
{
public class ViewModelIndexer
{
public ViewModelIndexer()
@jpoehls
jpoehls / Hg-Export.ps1
Created July 12, 2011 13:22
Hg-Export # PS function to export a diff file of uncommitted changes in the working repo
function Hg-Export([string]$Path) {
<#
.SYNOPSIS
Exports all uncommitted changes in the current HG repository
to a git formatted diff file at the specified path.
The resultant diff file can be re-imported into a repo using: hg import changes.diff
.EXAMPLE
Hg-Export changes.diff
@jpoehls
jpoehls / RawResponseFromFiddler.txt
Created October 26, 2011 16:15
Glimpse blank response bug
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Encoding: deflate
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Compressed-By: HttpCompress
X-Glimpse-RequestID: e379b425-9573-477e-81d8-7eda4d1643c6
X-Powered-By: ASP.NET
Date: Wed, 26 Oct 2011 16:13:21 GMT
@jpoehls
jpoehls / fibonacci.hs
Created February 27, 2012 19:07
Fibonacci Haskell
-- seen here: http://academicearth.org/lectures/introduction-to-haskell (@ ~14m)
-- returns an infinite fibonacci sequence
fib = 1:1:zipWith (+) fib (tail fib)
@jpoehls
jpoehls / ios_6_wishlist.md
Created March 21, 2012 17:19
iOS 6 Wish List

Not necessarily in order of preference.

  1. Picture lock, ala Windows 8. Not face recognition, the photo password thing.
  2. Ability for apps to plug into Spotlight. Ex. Search my Evernote from Spotlight.
  3. More app integration points like "Open With". Allow any app to register itself as a "photo provider" (fb, flickr) or "share provider" (twitter, fb). Instead of importing photos from the camera roll, allow import from any photo provider, of which the camera roll is just one of many. Android has this as well as Windows Phone 7 and Windows 8.

The photos example is one of the best, but also imagine a more generic "document provider". I'm in a text editing app like Byword and choose to "open document", I see a list of apps that provide documents. In that list is Dropbox. I open the file. Document providers are 2-way, so as I make changes to my document in Byword it is saving back to Dropbox. Byword doesn't have to do anything special to implement this. The Dropbox app, as provider, handles all

@jpoehls
jpoehls / master.xml
Created May 4, 2012 18:49
NewsBlur Github feed snippets
<!-- https://github.com/samuelclay/NewsBlur/commits/master.atom -->
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
<id>tag:github.com,2008:/samuelclay/NewsBlur/commits/master</id>
<link type="text/html" rel="alternate" href="https://github.com/samuelclay/NewsBlur/commits/master"/>
<link type="application/atom+xml" rel="self" href="https://github.com/samuelclay/NewsBlur/commits/master.atom"/>
<title>Recent Commits to NewsBlur:master</title>
<updated>2012-05-03T19:09:36-07:00</updated>
<entry>
@jpoehls
jpoehls / gist:2709843
Created May 16, 2012 12:04
jabbr.rpxnow.com/signin/get_login_info
{
"startedDateTime": "2012-05-16T11:57:32.161Z",
"time": 94,
"request": {
"method": "GET",
"url": "https://jabbr.rpxnow.com/signin/get_login_info?time=1337169452162",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Accept-Encoding",
@jpoehls
jpoehls / gist:2828914
Created May 29, 2012 15:00
Handling a row click in SlickGrid
var grid = new Slick.Grid(...);
grid.onClick.subscribe(function (e, args) {
// args:
// - cell
// - grid
// - row
var dataItem = args.grid.getDataItem(args.row);
@jpoehls
jpoehls / gist:2831568
Created May 30, 2012 00:05
Find the <form/> that contains jQuery element
var $form = $('.item').closest('form');
@jpoehls
jpoehls / blink_ip.pl
Created June 10, 2012 15:59 — forked from chrismeyersfsu/blink_ip.pl
Raspberry Pi Blink Ip Address