Skip to content

Instantly share code, notes, and snippets.

View mwbrooks's full-sized avatar
🏠
Working from home

Michael Brooks mwbrooks

🏠
Working from home
View GitHub Profile
#include <cstdio>
// Class Definition
//
class MyClass
{
public:
void print(int value1, int value2 = 200);
};
#include <cstdio> // printf function
class SuperClass
{
public:
SuperClass(int foo)
{
printf("SuperClass constructor fired with value %d\n", foo);
}
};
// Uncomment to disable assertions.
// NDEBUG macro must be defined before #include <assert.h>
// #define NDEBUG
#include <assert.h>
int main (int argc, char * const argv[]) {
int *goodInteger = new int(2);
int *badInteger = NULL;
#include <typeinfo>
using namespace std;
int myNumber = 5;
const char *name1 = typeid(int).name(); // i on gcc, int on VSC++
const char *name2 = typeid(myNumber).name(); // i on gcc, int on VSC++
# Local Branch
# ============
# Create
git branch my_feature
git checkout -b my_feature
# Delete
git branch -d my_feature
# Remote Branch
// Method Signature
//
- (BOOL)searchFor:(NSString *)string
direction:(BOOL)forward
caseSensitive:(BOOL)caseFlag
wrap:(BOOL)wrapFlag
// Selector (Method Name)
//
searchFor:direction:caseSenstitive:wrap
# Show all tags
git tag
# Create tag
git tag <tag_name> <branch_name - default is current branch>
# Checkout a tag
git checkout <tag_name>
# Are you using the BASH shell?
echo $SHELL # /bin/bash
#
# Day-to-day shortcuts for the BASH shell
# ---------------------------------------
#
# up/down arrows => View your command history
#
# tab => Auto-complete file and directory names from ...
typeof NaN === 'number' // true
Infinity === 1/0 // true
0.1 + 0.2 === 0.3 // false