Skip to content

Instantly share code, notes, and snippets.

View nastysloper's full-sized avatar
💭
Climbing Rocks, Running Trails, Writing Code

Richard Vogt nastysloper

💭
Climbing Rocks, Running Trails, Writing Code
  • Accenture Federal Services
  • San Antonio, Texas
View GitHub Profile
@nastysloper
nastysloper / cols.txt
Created January 28, 2019 20:24 — forked from 0/cols.txt
Brief awk tutorial
abc 1 2 3
def 4 5 6
ga 7 9 10
hij 1 5 99
@nastysloper
nastysloper / vim cheatsheet.md
Created September 10, 2018 21:42 — forked from jessedearing/vim cheatsheet.md
Vim Cheatsheet

#Vim Cheat Sheet

  • gqip - Reformats paragraph to textwidth
  • gq - Reformats selection
  • :Tab /= - Equally spaces based on the = symbol (requires Tabular vim plugin)
  • :setf language - Changes current language
  • :set language=language - Changes current language
  • <C-a> - Increments the number under the cursor
  • <C-x> - Decrements the number under the cursor
  • ~ - Toggles case and moves to next character in normal mode
@nastysloper
nastysloper / Android Studio .gitignore
Created January 4, 2018 02:38 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@nastysloper
nastysloper / curl.md
Created October 19, 2017 16:18 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

# A guide to prevent pain and suffering while upgrading to OS X Mavericks
# This will vary greatly depending on system set up, so read the instructions carefully
# Back up Virtulenvs
####################
# Very important!
# For each virtualenv you have, run "pip freeze > requirements.txt" while in the activated virtualenv
# in order to prevent loss of dependencies during the upgrade.

Got this tip from the master Myles Byrne (@quackingduck)

git-sh loads your bash config from ~/.bashrc not ~/.bash_profile

So one way to fix this (this is how my machine is set up) is to copy your ~/.bash_profile to ~/.bashrc and then change ~/.bash_profile to just have this line:

test -f ~/.bashrc && source ~/.bashrc

Continuous Integration for Fun and Profit

Continu-what?

Definition: the practice of frequently integrating one's new or changed code with the existing code repository -Wikipedia

Merging new code into master often sounds awesome, but we've been learning the value of testing and the importance of a passing test suite.

But, as your projects grow, your test suite should grow as well. We're all lazy and forget to run the entire test suite everytime we create a new commit. For large projects, running the entire test suite can take hours. So we do what all lazy people do, make a computer do the work for us.

Definitions

General Testing

  • TDD Test Driven Development. Write examples before implementation.
  • BDD Behaviour-Driven Development is about implementing an application by describing its behavior from the perspective of its stakeholders. (The Rspec Book)
  • RSpec (mention alternatives, write a simple hand sewn test)

Testing Terms

/*
* What are the objects in this exercise?
* What are their properties and methods?
* How do your objects interact with their respective DOM elements?
*/
var GroceryList = function () {
this.items = [];
this.totalPrice = 0;
};
GroceryList.prototype.addItem = function (item) {
@nastysloper
nastysloper / zoo.js
Last active December 19, 2015 07:29 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
// Object constructor
function Animal(){};
// Object literal
var Zoo = {