Skip to content

Instantly share code, notes, and snippets.

View itsjohncs's full-sized avatar

John Sullivan itsjohncs

View GitHub Profile
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.jdbc.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import akka.util.duration._
import bootstrap._
class RecordedSimulation extends Simulation {
@itsjohncs
itsjohncs / main.cpp
Created November 19, 2012 07:15
Vector Exercises
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void print_vector(vector<string> values) {
for (int i = 0; i < values.size(); ++i) {
cout << values.at(i) << endl;
}
@itsjohncs
itsjohncs / braces.cpp
Created November 19, 2012 23:40
Lab 8, Exercise 2 Possible Solution
#include <iostream>
#include <vector>
using namespace std;
bool isStartingBrace(char v) {
string braces = "[{(";
return braces.find(v) != -1;
}
@itsjohncs
itsjohncs / galah-web.sh
Created December 4, 2012 02:51
galah.web init script
#!/bin/bash
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
@itsjohncs
itsjohncs / galah-sisyphus.sh
Last active October 13, 2015 13:07
galah.sisyphus init script
#!/bin/bash
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
@itsjohncs
itsjohncs / main.sh
Created December 6, 2012 07:11
Amazing Tic-Tac-Toe Game
#!/bin/bash
set -e
FIRST_ROW=("0" "1" "2")
SECOND_ROW=("3" "4" "5")
THIRD_ROW=("6" "7" "8")
function print_board() {
echo "+-------+"
#!/usr/bin/env python
# First grab the test request information from stdin
import json
import sys
test_request = json.load(sys.stdin)
import os.path
testables_directory = test_request["TESTABLES_DIRECTORY"]
main_path = os.path.join(testables_directory, "main.cpp")
try {
while (true) {
again: hack_more();
}
} catch (CriticalFailure e) {
sleep(-1);
goto again;
}
#include <iostream>
using namespace std;
int main() {
int a = 5;
int b = 10;
cout << "a: " << a << " b: " << b << endl;
a = b;
class Rational
{
private:
int numer;
int denom;
public:
Rational();
Rational(int);
Rational(int, int);
const Rational add(const Rational &) const;