Skip to content

Instantly share code, notes, and snippets.

View tterb's full-sized avatar
Building stuff

Brett Stevenson tterb

Building stuff
View GitHub Profile
@tterb
tterb / FormattingBadges.md
Created September 24, 2016 13:18
Formatting Badges
@tterb
tterb / cppArgs
Last active November 11, 2016 11:53
Reading command-line arguments in C++
int main(int argc, char* argv[]){
if(argc > 1) //if there is an argument
/* Do something */
string firstArg = argv[1];
}
@tterb
tterb / Makefile
Created November 11, 2016 11:56
C++ Makefile example
# makefile
# define target, its dependencies and files
p5: main.o LinkedList.o
g++ -o p4 main.o LinkedList.o
# define how each object file is to be built
main.o: main.cpp LinkedList.h
g++ -c main.cpp
@tterb
tterb / cppReadFile
Created November 11, 2016 12:40
Read from a file in C++
ifstream fileIn(filename.c_str());
if(!fileIn)
cerr << "ERROR: Unable to read from " << filename << endl;
string line;
while(getline(fileIn, line)) { // read line into a vector
input.push_back(line);
line.clear();
}
@tterb
tterb / Powershell_profile.ps1
Last active April 26, 2017 21:45
Powershell Profile
# Set-Up
$Shell = $Host.UI.RawUI
$size = $Shell.WindowSize
$size.width=90
$size.height=30
$Shell.WindowSize = $size
$size = $Shell.BufferSize
$size.width=140
$size.height=2500
@tterb
tterb / zipSnapshot.md
Last active March 19, 2019 21:04
Download the current snapshot of GitHub repo as .zip file

Download the current snapshot of a repo as a .zip archive

[current snapshot](https://github.com/<username>/<repo>/zipball/master)
@tterb
tterb / GitHubDownloads.md
Last active June 5, 2024 00:05
Downloads README Badge

Github All Releases

[![Github All Releases](https://img.shields.io/github/downloads/username/repo/total.svg)](https://github.com/username/repo/releases)
#!/usr/bin/python
# Returns the common lines between each of the 'n' specified files
python -c 'import sys;print " ".join(sorted(set.intersection(*[set(open(a).readl
ines()) for a in sys.argv[1:]])))'
@tterb
tterb / Gulpfile.js
Created June 25, 2017 21:20
The Gulpfile for my website
var gulp = require('gulp'),
shell = require('gulp-shell'),
minifyHTML = require('gulp-minify-html'),
sass = require('gulp-sass'),
importCss = require('gulp-import-css'),
autoprefixer = require('gulp-autoprefixer'),
uncss = require('gulp-uncss'),
minifyCss = require('gulp-minify-css'),
rename = require('gulp-rename'),
glob = require('glob'),
@tterb
tterb / frontmatter.yml
Last active February 24, 2018 04:19
A default frontmatter template for https://github.com/JonSn0w/Hyde
---
title:
desc:
date:
options:
image:
categories:
tags:
priority:
---