Skip to content

Instantly share code, notes, and snippets.

View ariporad's full-sized avatar

Ari Porad ariporad

View GitHub Profile
@ariporad
ariporad / Instructions.md
Created January 23, 2022 18:58
SoftDes Setup Instructions for MacOS

SoftDes Setup Instructions for MacOS

So, you'd like to use a Mac for SoftDes? Welcome to the civilized world! This guide will tell you how to do it. These instructions will work for either Intel or Apple Silicon/M1 Macs.

Here's how it works: Unlike Windows, macOS is Unix on the inside. (Unix and Linux are, for the sake of this class, interchangeable.) So instead of juggling Linux/Ubuntu inside Windows, macOS can serve the role of both.

Warning: Do this at your own risk. Windows 10 on an Olin Laptop is the only officially supported platform for SoftDes. This is simply from my experimentation.

You'll want to have the normal setup instructions open too. They have lots of good information and explaination (most of which doesn't change for Mac). In particular, all of the "check" stages are the same.

@ariporad
ariporad / .bashrc
Created March 15, 2021 17:10
QEASim CLI Helpers
# Add this to your .bashrc or .zshrc
export MATLAB="/Applications/MATLAB_R2020a.app" # You'll need to update this to match your install of MATLAB
export MATLAB_CLI="$MATLAB/bin/matlab"
alias matlab="$MATLAB_CLI -nodesktop -nosplash"
function qeasim() {
# The above alias wasn't working in this function
$MATLAB_CLI -nodesktop -nosplash -nojvm -r "qeasim $*"
}
@ariporad
ariporad / tweettactoe.js
Created June 1, 2016 22:49
Tweet Tac Toe
'use strict';
const Twitter = require('twitter');
const TicTacToe = require('tictactoe-agent');
const USERNAME = 'USERNAME';
const client = new Twitter({
consumer_key: 'TWITTER CONSUMER KEY',
consumer_secret: 'TWITTER CONSUMER SECRET',
access_token_key: 'TWITTER ACCESS TOKEN',
@ariporad
ariporad / zero-downtime-deploy.sh
Created May 6, 2016 04:36
Rover DevOps Challenge Solution
if [[ $# -eq 0 ]] ; then
echo 'Usage: $0 VERSION'
echo ''
echo 'Does a Zero-Downtime deploy of VERSION to worker, web-1 and web-2, including DB migrations.'
echo ''
exit 0
fi
ssh root@worker "./materialize $1 && ./db-migrate $1 && ./restart-worker"
ssh root@web-1 "./lb-remove && ./materialize $1 && ./db-migrate $1 && ./restart-web && ./lb-join"
#!/bin/bash
##
# See https://gist.github.com/ariporad/8ceab6c98958c0bc8f17
##
USER="YOUR_GITHUB_USERNAME"
TOKEN="see git.io/token"
echo -n "GitHub Repo (e.g. foo/bar): "
@ariporad
ariporad / EMIW.txt
Created January 2, 2016 00:41
Copyright Headers
/* (c) 2016 EMIW, LLC. emiw.xyz/license */
@ariporad
ariporad / README.md
Created January 1, 2016 16:24
Gitignores

Gitignores

A collection of gitignores I like to use for projects

@ariporad
ariporad / README.md
Last active December 31, 2015 21:36
Archives

Archives

I frequently find that I have old projects that I don't necessarily want ot delete, but I want to get out of the way. This is my setup to make that [easy][xkcd-automation].

My setup has two parts: A repo (ex. ariporad/archive), and a script (this one):

  • The repo This repo is a collection of orphan branches, one per project. Since some of these projects are private (and I'm lazy), the entire repo is private.
  • The script This script takes the name of a file/folder ($folder) as an argument. It then:
@ariporad
ariporad / README.md
Last active December 7, 2017 17:53
git-refork

git-refork

I really wanted a way to re-sync a fork with upstream, so this is it. Just put it in your path, and make sure that you have a remote called upstream that points to the original project.

WARNING: For forks only. If you use it on a non-fork project, bad things will happen. This will re-write history, so be careful.

@ariporad
ariporad / app.js
Created August 30, 2015 18:20
Simple express app
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');