Skip to content

Instantly share code, notes, and snippets.

View detroitpro's full-sized avatar
☠️

Eric Polerecky detroitpro

☠️
View GitHub Profile
@jc-torresp
jc-torresp / access-pi-anywhere.md
Created September 21, 2019 05:12
Configuration to access Raspberry Pi from anywhere with UPnP port forwarding

Access Raspberry Pi from anywhere

Dynamic DNS

We need to use so called Dynamic DNS (DDNS) to create and dynamically update a mapping between a chosen domain name and an “external” IP address of our Raspberry Pi (i.e. router IP address).

  • Look for a DDNS provider.
  • Register a new user account.
  • Choose a desire domain name.
  • Configure it on router.
public class Startup : IStartup
{
private static readonly Assembly[] ControllerAssemblies = { typeof(Startup).GetTypeInfo().Assembly };
public Startup(IHostingEnvironment environment, ILoggerFactory logging)
{
Environment = environment;
ConfigureLogging(logging);
}
@rdavisau
rdavisau / InlineTableViewSource
Last active August 29, 2015 14:15
InlineTableViewSource
/*
Snippet Name: InlineTableViewSource
Platform: iOS
Function: A subclass of UITableViewSource that allows you to define UITableViewDataSource and UITableViewDelegate methods inline, rather than subclassing. Lets you take advantage of closures and use tableviews where you can't create subclasses, like in Xamarin Sketches (compile and reference).
Funcs/Actions are prefixed with "_", feel free to alter if this disagrees with your styling guidelines.
Usage:
var cellId = new NSString("cell");
container.Register(Classes.FromAssemblyInThisApplication()
.BasedOn<UserControl>()
.Configure(x => x.LifestyleTransient()));
@detroitpro
detroitpro / FlashHelpers
Created December 16, 2010 04:44
Rob Conery's ASP.NET MVC FlashHelpers class - ala: rails
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
namespace System.Web.Mvc {
public static class FlashHelpers {
public static void FlashInfo(this Controller controller,string message) {