Skip to content

Instantly share code, notes, and snippets.

View rayhamel's full-sized avatar

Ray Hamel rayhamel

  • Greater Boston Area, MA
View GitHub Profile
@rayhamel
rayhamel / brewoutput
Last active April 18, 2018 01:04
Brew output
$ brew doctor
Your system is ready to brew.
$ brew config
HOMEBREW_VERSION: 1.6.1-18-g714bf51
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 714bf51524eb9c56b189d0d4f5a7a1cfe8b9d6d3
Last commit: 11 hours ago
@rayhamel
rayhamel / BenchmarkArray.cc
Last active November 10, 2017 19:13
Sorting Benchmarker
#include <algorithm>
#include <array>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <random>
#if !defined(__GNUC__) && !defined(__attribute__)
@rayhamel
rayhamel / WhatHaveIDone.cc
Created September 24, 2017 02:50
Abuse of the C++ language
/* https://wandbox.org/permlink/69aE7gIqBcWonJB0 */
constexpr auto operator""_times(unsigned long long i) noexcept
{
return [i](auto &&f) {
for (auto n{i}; --n; f());
return f();
};
}
#!/usr/bin/python
#
# Version 2
# 9 July 2013
#
# Modified to use xml format output from timegenie instead of text file
#
# Version 3
# 7 March 2014
#
@rayhamel
rayhamel / ptc-logo.txt
Created September 19, 2017 19:26
PTC Logo ANSI Art
░▒▓▓▓▒░
░░▒▓▓▓▓▓▓▓▓▓▓▓▒░░
░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░
░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░
░▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓░
░▓▓▓▓▓▓▓▓▓▓▓▓░░░░▓░░░░▓▓▓▓▓▓▓▓▓▓▓▓░ dd
░▓▓▓▓▓▓▓▓▒░░░▓▓▓▓▓▓▓▓▓░░░▒▓▓▓▓▓▓▓▓░ 88
░▓▓▓▓▓░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 8b,dPPYba, MM88MMM ,adPPYba,
░▓▓░░░▒▒▒▒▒▒░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 88P' "8a 88 a8" ""
░░▒▒▒▒▒▒▒▒▒▒▒▒▒░░░▓▓▓▓▓▓▓▓▓▓▓▓▓░░ 88 d8 88 8b
#!/usr/bin/python
#
# Version 2
# 9 July 2013
#
# Modified to use xml format output from timegenie instead of text file
#
# Version 3
# 7 March 2014
#
#ifndef SLURP_H
#define SLURP_H
class Slurp {
void *begin_{ nullptr };
void *end_;
public:
Slurp() = delete;
Slurp(const Slurp &) = delete;
Slurp &operator=(Slurp) = delete;
throw new Error("The sky is falling!");
@rayhamel
rayhamel / ajax_and_redis.md
Last active October 4, 2019 13:41
Redis, AJAX, Testing AJAX Walkthrough

This walkthrough uses our group project as an example; we will be creating an upvote/downvote system.

Redis

Install Redis and the Redis gem (in terminal).

$ brew install redis
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
@rayhamel
rayhamel / cheatsheet.md
Last active August 14, 2016 16:52
Ray's Algorithms and Interview Questions Cheat Sheet!

ALGORITHMS AND INTERVIEW QUESTIONS CHEAT SHEET

DATA STRUCTURES

A data structure is a group of data organized in the computer's memory by certain specific rules defining predictable relationships between the data. Arrays, hashes and relational databases are all examples of data structures.