This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AsyncLazyPipeline<TSource> | |
{ | |
private Func<Task<TSource>> Expression { get; } | |
public AsyncLazyPipeline(Func<Task<TSource>> expression) | |
{ | |
Expression = expression; | |
} | |
public Task<TSource> Flatten() => Expression(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* DataGrip extension to export results to markdown. | |
* The markdown table format is supported by Github and Jira. I haven't tested others. | |
* | |
* Tested on DataGrip 2016.2.2 | |
* - Open the File view. View -> Tool Windows -> Files | |
* - Activate the "Scratches" tab. You should see "Files", "Scopes", and "Scratches". | |
* - Copy this file to Extensions/Database Tools and SQL/data/extractors/Markdown.JavaScript.md.js | |
* - Run a query with some results. | |
* - Change the export format to Markdown.JavaScript.md.js and click "To Clipboard". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Python script to find the largest files in a git repository. | |
# The general method is based on the script in this blog post: | |
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# | |
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch | |
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I wasn't able to find a single example on how to actually use Dapper's new TVP, so I though I'd add one. | |
First of all, you will need to install the Dapper.TVP package from NuGet. | |
The main item to note is the need to create and populate a list of SqlDataRecords. This is then used to used as part of the | |
input parameter for Dapper's TableValueParameter. | |
The API is thus: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script to route traffic from home network through VPN selectively. | |
# Based off the discussion at http://www.smallnetbuilder.com/forums/showthread.php?t=9311 | |
# The setup is a Roku box, a Home PC running Plex, and a Synology NAS with a torrent client running a web interface. | |
# The aim is to have all traffic from Roku go through the VPN, all traffic from the Home PC (and all other devices) bypassing the VPN, | |
# and the Synology NAS using the VPN. There are however some exceptions. Since Plex uses port 32400, Roku has to bypass the VPN when | |
# using that port. In addition, port 9091 has to bypass the VPN as well in order to access the Synology torrent client. | |
# | |
# Requirements: Asuswrt-Merlin with OpenVPN already set up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @tableName varchar(200) | |
declare @columnName varchar(200) | |
declare @nullable varchar(50) | |
declare @datatype varchar(50) | |
declare @maxlen int | |
declare @sType varchar(50) | |
declare @sProperty varchar(200) | |
DECLARE table_cursor CURSOR FOR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat /etc/init/webapps.conf | |
description "vhosts via NodeJS, Spark, and Connect" | |
version "1.1" | |
author "AJ ONeal" | |
# Upstart has nothing in $PATH by default | |
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
# Keep the server running on crash or machine reboot | |
respawn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.AspNet.SignalR; | |
namespace Airtime.Hubs | |
{ | |
/// <summary> | |
/// Hubs that have injected dependencies which must be scoped to the same lifetime should |