Skip to content

Instantly share code, notes, and snippets.

@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@runewake2
runewake2 / PhilosophersWithWaiter.cs
Created December 23, 2016 03:50
Solution for the dining philosophers in C# - Solution uses a waiter to oversee acquiring of chopsticks
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DiningPhilosophers
{
class Program
@mcguffin
mcguffin / git-release
Last active December 26, 2022 11:09
Shell script to create GitHub release
#!/bin/bash
MESSAGE="0"
VERSION="0"
DRAFT="false"
PRE="false"
BRANCH="master"
GITHUB_ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
# get repon name and owner
@davidkwast
davidkwast / Dockerfile
Created February 9, 2018 11:24
FTP Server Container
FROM debian:wheezy
MAINTAINER David Kwast <[email protected]>
RUN apt-get update && apt-get -y install proftpd && apt-get clean
RUN useradd -g root -d /var/www/html ftpuser && (echo "password";echo "password") | passwd ftpuser
RUN (echo "password";echo "password") | passwd root
@elijahmanor
elijahmanor / Chat.after.js
Created April 27, 2018 16:02
Code from Migrating from Unsafe React Lifecycle Hooks https://www.youtube.com/watch?v=G9S1IghlkCI
import React, { Component } from "react";
import Button from "./Button";
import Message from "./Message";
import { getMessage } from "./utils";
export default class Chat extends Component {
state = {
isStreaming: this.props.isStreaming,
messages: [getMessage()]
};