Skip to content

Instantly share code, notes, and snippets.

View lostphilosopher's full-sized avatar

Wyatt Andersen lostphilosopher

View GitHub Profile
#!/bin/bash
echo "[1. echo]"
echo "Hello World"
GREETING="Hello World"
echo "[2. variable]"
echo "${GREETING}"
echo "[3. function]"
@lostphilosopher
lostphilosopher / new_relic_oauth_synthetic_api_example.js
Last active September 19, 2022 23:40
New Relic Synthetic API call with OAuth 2.0 (client_credentials flow) Raw
var assert = require('assert');
function new_relic_callback(err, response, body) {
assert.equal(response.statusCode, 200, 'Expected a 200 OK response');
};
function api_request_callback(err, response, body) {
var parsed_body = JSON.parse(body);
var api_request = {
@lostphilosopher
lostphilosopher / testing_rails_apps.md
Created May 10, 2017 15:14
How to test Rails Apps.

Testing Rails Applications

General

One size does not fit all. Testing strategies serve one purpose - to prevent and fix bugs earlier in the development process. While they can also document your code and provide other additional benefits - fixing and preventing bugs must be their number one goal. Whatever strategy fits your project, your team, and your code base - and fulfills that goal - is a good strategy. The core of any good Rails testing strategy is Better Specs and The Agile Test Pyramid.

Finally, tests must be written to be re-written. Business requirements will change. Code architecture will change. Variables will be renamed. Your tests should enable and embolden these changes, not prohibit and prevent them.

"All is flux." - Heraclitus

@lostphilosopher
lostphilosopher / README_template.md
Last active March 17, 2017 16:16
README.md Template
@lostphilosopher
lostphilosopher / avro_test.rb
Created February 9, 2017 16:04
Test for Avro support of `doc`
require 'avro'
require 'pry'
schema =
{
"type": "record",
"name": "User",
"fields":
[
{
@lostphilosopher
lostphilosopher / braintree_new_transaction_testing_methodology.md
Last active December 9, 2015 19:29
Braintree New Transaction Testing Methodology

Steps to reproduce:

  1. Log into our account on Braintree Production (https://www.braintreegateway.com/login) (I can get you credentials if need them)
  2. Click on "New Transaction” (https://www.braintreegateway.com/merchants/k7nqq4yf6ndvwzs9/transactions/new)
  3. Pick a “Merchant Account"
  4. Check “Submit for Settlement”
  5. Fill in the “Amount” (I used "0.01”)
  6. Fill in "Credit Card Number" with a real number
  7. Fill in “Expiration Date” with the card's real expiration date
  8. Fill in "Card Verification Value” with the card's real CVV
@lostphilosopher
lostphilosopher / garage_bugs_and_features.md
Last active August 29, 2015 14:24
Bug Reporting and Feature Tracking for Garage Projects

Bug Reporting and Feature Tracking for Garage Projects

##Summary

To keep teams in sync and working quckly all project / work / issue conversations should be documented in Trello, and not in emails, chats, etc.

If you have a future feature idea, or bug to report - put it on Trello and you can safely assume it's on the design / dev team's radar. If you need immediate response or feedback, reference the team member with the @ sign.

##Documenting a Future Feature / Bug Report in Trello

@lostphilosopher
lostphilosopher / pre-push
Created June 4, 2015 00:55
pre-push that prevents a push to master
# Color Definitions
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
printf "${BOLD}Preventing restricted pushes...${NORMAL}\n\n"
protected_branch='master'
@lostphilosopher
lostphilosopher / nodb_prototype_with_files.php
Last active August 29, 2015 14:00
nodb prototype with files
<?php
/* This class exists as a placeholder for a database it should
* suffice for prototyping purposes, but shoud NOT be used in
* production
*/
class NoDb {
protected $noDbFile = '';
<?php
// NoDB: Build a class for creating and stroing json files, and then extracting their contents. Could be tied to prototyping framework.
$preJson = array(
'method' => 'create',
'data' => array(
'table' => 'blog',
array(
'title' => 'Lorem ipsum: Part 1',
'text' => 'See spot run. Look, see spot play 1.'