Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Nate McMaster natemcmaster

I may be slow to respond.
View GitHub Profile
natemcmaster / web.config
Last active Dec 19, 2015
Configuring CakePHP on Azure
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<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 name="Imported Rule 1" stopProcessing="true">
natemcmaster /
Last active Dec 20, 2015
Bash command for getting the local machine ip address from ipconfig
ipconfig | grep 'IPv4' | awk -F ': ' '{print $2}'
natemcmaster / truncation.cpp
Created Sep 19, 2013
Demo of integer math vs. double math
View truncation.cpp
#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 / Fruit.cpp
Created Sep 21, 2013
Sample of inheritance and vectors.
View Fruit.cpp
* Fruit.cpp
* Created on: Sep 21, 2013
* Author: nmcmaster
#include "Fruit.h"
using namespace std;
natemcmaster / boolean.cpp
Last active Dec 23, 2015
Tutoring: sample of various ways to use bool in C++
View boolean.cpp
#include <iostream>
using namespace std;
bool foobar(int f){
return (f==7);
int main(){
bool foobarcondition=foobar(7);
natemcmaster / pointers.cpp
Created Sep 25, 2013
Tutoring: sample of how to various ways use pointers.
View pointers.cpp
#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 / scoping.cpp
Created Sep 25, 2013
Tutoring: demonstration of variable scope in C++;
View scoping.cpp
#include <iostream>
using namespace std;
void someFunction();
int number = 0; // Scoped globally (everywhere inside this C++ program)
natemcmaster / looping.cpp
Created Oct 1, 2013
Tutoring: demo of using loops to get user input from cin
View looping.cpp
#include <iostream>
using namespace std;
int main()
double miles;
cout << "Enter miles:" << endl;
natemcmaster / queue.cpp
Created Oct 9, 2013
Tutoring: example of creating a simple data structure with dynamic memory allocation and avoiding memory leaks
View queue.cpp
#include <iostream>
#include "queue.hpp"
void Queue::add(int insertValue){
Node* nextItem = new Node();
nextItem->value = insertValue;
View nm.zsh-theme
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
PROMPT='%{$fg[$NCOLOR]%}%m:%c ➤ %{$reset_color%}'
RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}'