Skip to content

Instantly share code, notes, and snippets.

@neilt6
neilt6 / AudioTrackOut.cs
Last active January 19, 2025 13:43
NAudio Driver for Xamarin.Android
using Android.Media;
using NAudio.Wave;
using System;
using System.Threading;
namespace NAudio.Wave
{
/// <summary>
/// Represents an Android wave player implemented using <see cref="AudioTrack"/>.
/// </summary>
@ubante
ubante / gitflow-breakdown.md
Last active March 24, 2024 13:26 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@jpoehls
jpoehls / BaseController.cs
Created December 2, 2011 19:38
Newtonsoft Json Results for MVC
using System;
using System.Linq;
using System.Web.Mvc;
public abstract class BaseController : Controller
{
protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding)
{
return new JsonNetResult
{
@leniency
leniency / IQueryableExtensions.cs
Created August 1, 2011 22:31
Modifications to allow CamelCase.NestedProperties
/// <summary>
/// Provides projection mapping from an IQueryable sourceto a target type.
///
/// This allows from strongly-typed mapping and querying only necessary fields from the database.
/// It takes the place of Domain -> ViewModel mapping as it allows the ViewModel to stay as
/// IQueryable. AutoMapper works on in-memory objects and will pull all full records to perform
/// a collection mapping. Use AutoMapper for Input -> Domain scenarios, but not DAL.
///
/// Reference: http://devtrends.co.uk/blog/stop-using-automapper-in-your-data-access-code
/// </summary>
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
output =
(from i in session.Query<Input>()
select i)
.Project().To<Output>(
mapper =>
mapper
.Map(o => o.BasicCustom, i => i.Custom)
.Map(o => o.WackyCustom, i => "modified " + i.Custom)
.Ignore(o => o.Ignored)
)