Skip to content

Instantly share code, notes, and snippets.

View natemcmaster's full-sized avatar

Nate McMaster natemcmaster

View GitHub Profile
@natemcmaster
natemcmaster / Dockerfile
Last active November 11, 2015 18:48
ASP.NET Development Image
FROM ubuntu:trusty
RUN apt-key adv --keyserver pgp.mit.edu --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo 'deb http://download.mono-project.com/repo/debian wheezy main' >> /etc/apt/sources.list.d/mono-xamarin.list \
&& echo 'deb http://download.mono-project.com/repo/debian alpha main' >> /etc/apt/sources.list.d/mono-xamarin.list \
&& apt-get update -qq \
&& apt-get install -y mono-devel mono-vbnc ca-certificates-mono nuget referenceassemblies-pcl \
&& rm -rf /var/lib/apt/lists/*
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace Sqlite3Test
{
public class Program
{
public static void Main()
{
<!--This file was automatically generated and may be overwritten. Do not edit this file manually.-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library>
<TypeInstantiation Name="System.Collections.Generic.IEnumerable" Arguments="EFGetStarted.UWP.Blog" Dynamic="Required All" />
<TypeInstantiation Name="System.Collections.Generic.IAsyncEnumerable" Arguments="EFGetStarted.UWP.Blog" Dynamic="Required All" />
<TypeInstantiation Name="System.Linq.IOrderedEnumerable" Arguments="EFGetStarted.UWP.Blog" Dynamic="Required All" />
<Type Name="Microsoft.Data.Entity.Storage.IDatabase" Dynamic="Required All">
<MethodInstantiation Name="CompileQuery" Arguments="EFGetStarted.UWP.Blog" Dynamic="Required" />
<MethodInstantiation Name="CompileQuery" Arguments="System.Collections.Generic.IEnumerable{EFGetStarted.UWP.Blog}" Dynamic="Required" />
<MethodInstantiation Name="CompileQuery" Arguments="System.Linq.IOrderedEnumerable{EFGetStarted.UWP.Blog}" Dynamic="Requi
@natemcmaster
natemcmaster / web.config
Last active December 19, 2015 08:29
Configuring CakePHP on Azure
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect static resources" stopProcessing="true">
<match url="^(ico|img|css|files|js|font)(.*)$" />
<action type="Rewrite" url="app/webroot/{R:1}{R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 1" stopProcessing="true">
@natemcmaster
natemcmaster / myip_cygwin.sh
Last active December 20, 2015 17:19
Bash command for getting the local machine ip address from ipconfig
ipconfig | grep 'IPv4' | awk -F ': ' '{print $2}'
@natemcmaster
natemcmaster / truncation.cpp
Created September 19, 2013 23:06
Demo of integer math vs. double math
#include <iostream>
using namespace std;
int main(){
int half = 3/2;
cout << half << endl; //Prints 1 because int's throw away the decimal
double intMath= 3 / 2;
cout<<intMath<<endl; //Prints 1, not what we expected
@natemcmaster
natemcmaster / Fruit.cpp
Created September 21, 2013 20:44
Sample of inheritance and vectors.
/*
* Fruit.cpp
*
* Created on: Sep 21, 2013
* Author: nmcmaster
*/
#include "Fruit.h"
using namespace std;
@natemcmaster
natemcmaster / boolean.cpp
Last active December 23, 2015 21:19
Tutoring: sample of various ways to use bool in C++
#include <iostream>
using namespace std;
bool foobar(int f){
return (f==7);
}
int main(){
bool foobarcondition=foobar(7);
@natemcmaster
natemcmaster / pointers.cpp
Created September 25, 2013 16:37
Tutoring: sample of how to various ways use pointers.
#include <iostream>
#include <string>
using namespace std;
void appendAuthorName(string* bookTitle){
*bookTitle = *bookTitle + ": by J.K. Rowling"; // notice how I am modifying bookTitle but not returning anything. I am modifying the string directly
}
@natemcmaster
natemcmaster / scoping.cpp
Created September 25, 2013 16:50
Tutoring: demonstration of variable scope in C++;
#include <iostream>
using namespace std;
void someFunction();
int number = 0; // Scoped globally (everywhere inside this C++ program)