Skip to content

Instantly share code, notes, and snippets.

Omar Stefan Evans BlameOmar

Block or report user

Report or block BlameOmar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Setup lisp with slime on OS X.md

Setup lisp with slime on OS X

Install your favorite lisp interpreter

If you already have Homebrew, just open a terminal and type

$ brew install clozure-cl
@BlameOmar
BlameOmar / SSH Configuration.md
Last active Sep 16, 2016
SSH Configuration for Hunter CS students
View SSH Configuration.md

SSH Configuration for Hunter CS Students

To remotely access the CS Lab computers (cslab1, cslab2, etc.), you must use an SSH client. OpenSSH is part of (Mac) OS X, most modern Linux distributions and *BSD operating systems (e.g. Ubuntu, Fedora, FreeBSD, etc.). Windows does not include an SSH client as part of the operating system, so you may need to download and install one.

TODO: Add list of Windows SSH clients.

OpenSSH

@BlameOmar
BlameOmar / async_error_handling.md
Last active Aug 16, 2016
Asynchronous Error Handling in Swift 2.0
View async_error_handling.md

Asynchronous Error Handling in Swift 2.0

As Swift 1.0 did not include support for exceptions, a common error handling pattern was to use a Result enum that either took on a value on success, or an error on failure. In a way, this was superior to using exceptions, since being a instantiable type, Results could be passed around freely, enabling asynchronous code to use the same error handling mechanisim as synchronous code. Using Swift's robust support for custom operators, this also enabled Railway Oriented Programming for more functional oriented programers.

Swift 2.0 introduces throwable errors, which are similar to exceptions. However, like exceptions, thrown errors

@BlameOmar
BlameOmar / content_negotiation.lua
Last active Dec 22, 2015
Content Negotiation Lua Script for nginx
View content_negotiation.lua
-- Content negotiation for nginx using the lua module
-- Version 0.2
-- ©2013 Omar Stefan Evans
-- Based on the content negotiation script for Lighttpd written by Michael Gorven
-- (http://michael.gorven.za.net/blog/2009/04/13/content-negotiation-lighttpd-lua)
-- It is licensed under a BSD license.
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
-- this software and associated documentation files (the "Software"), to deal in
@BlameOmar
BlameOmar / main.cpp
Last active Aug 29, 2015
TicTacToe (2010)
View main.cpp
//Omar Evans
//TicTacToe Version 2
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#ifdef WIN32
#include <windows.h>
#define clear() system("cls")
#else
@BlameOmar
BlameOmar / mergesort.cpp
Last active Aug 29, 2015
mergeSort2 is an implementation of merge sort that uses O(n) extra space (copies the array exactly once) instead of O(nlog(n))
View mergesort.cpp
#include <iostream>
#include <vector>
#include <random>
using namespace std;
/* Returns whether a list is sorted */
bool isSorted(vector<int> & list);
/* Sorts a list using the standard merge sort algorithm everyone learns in school (requires O(nlog(n)) space) */
@BlameOmar
BlameOmar / MyLovelyProgram.c
Last active Aug 29, 2015
A lovely program. By Omar & Grace
View MyLovelyProgram.c
#include <stdio.h>
int main() {
char myLovelyString[] = "You're lovely...too";
puts(myLovelyString);
return 0;
}
@BlameOmar
BlameOmar / Run Time Type Information Example.cpp
Last active Aug 29, 2015
I wrote this because I couldn't find any practical examples, just information on dynamic_cast and typeid work. Supposedly this is because it's more taboo than goto and therefore no one should even think about using it. Obviously, I disagree.
View Run Time Type Information Example.cpp
/**
* ©2014 Omar Stefan Evans.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@BlameOmar
BlameOmar / Makefile
Last active Aug 29, 2015
Sample Makefile for Hunter CS Students
View Makefile
CXX = g++
CXXFLAGS = -Wall
DOCUMENTATION =
BUILD_SYSTEM_FILES = Makefile
DATA_FILES =
SOURCE_FILES = main1.cpp main2.cpp ClassA.h ClassA.cpp ClassB.h ClassB.cpp
You can’t perform that action at this time.