Skip to content

Instantly share code, notes, and snippets.


Aaron amfischer

View GitHub Profile
amfischer /
Last active May 20, 2022
Ubuntu commands cheat sheet
  • list all local users
    cut -d: -f1 /etc/passwd

  • list users and their permissions
    cat /etc/passwd

  • list groups
    cat /etc/groups

amfischer / main.js
Created Apr 13, 2019
Karlas google apps script
View main.js
function course(seats, name) {
this.seats = seats
this.enrolled = 0 = name
this.increment = function() {
this.isFull = function() {
return this.enrolled >= this.seats
amfischer / config
Created Nov 7, 2018
Multiple SSH Keys Config file
View config
Host frontend[can use any name here]
IdentityFile ~/.ssh/eagle-fe_rsa
Host backend[can use any name here]
IdentityFile ~/.ssh/eagle-be_rsa
// generate ssh key: ssh-keygen -t rsa -b 4096 -C "" [any phrase can go in quotes]
// make sure to paste public key into github
amfischer / main.js
Created May 19, 2017
Vue Tab Example
View main.js
Vue.component('tabs', {
template: `
<div class="tabs">
<li v-for="tab in tabs" :class="{ 'is-active': tab.isActive }">
<a :href="tab.href" @click="isSelected(tab)">{{ }}</a>
View laravel-install.txt
# Install Composer
sudo apt-get install composer
# Install Laravel and it's dependencies
composer global require "laravel/installer"
sudo apt-get install php7.0-zip php7.0-mbstring php7.0-xml
# add laravel executable to path
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
source ~/.bashrc
amfischer / answers.js
Created Feb 10, 2017
Algorithm Challenges
View answers.js
// #1
String.prototype.repeatify = function(num) {
var repeated_str = '';
for (var i = 0; i < num; i++) {
repeated_str = repeated_str + this;
return repeated_str;
amfischer / friendlyDates.js
Created Sep 28, 2016
FCC Algorithm Challenges
View friendlyDates.js
Convert a date range consisting of two dates formatted as YYYY-MM-DD into a more readable format.
The friendly display should use month names instead of numbers and ordinal dates instead of cardinal (1st instead of 1).
Do not display information that is redundant or that can be inferred by the user: if the date range ends in less than a year from when it begins, do not display the ending year.
Additionally, if the date range begins in the current year (i.e. it is currently the year 2016) and ends within one year,
the year should not be displayed at the beginning of the friendly range.
amfischer / app.js
Last active Jul 13, 2016
JavaScript Calculator
View app.js
$(document).ready(function() {
function convertToCode(str) {
var arr = str.split("");
var divideSymbol = decodeURI("%C3%B7");
var converted = {
return (e == "x") ? e = "*" : (e == divideSymbol) ? e = "/" : e;
amfischer / cat.rb
Last active Feb 9, 2016
Ruby Practice
View cat.rb
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
def feed(food)
puts "Mmmm, " + food + "!"
amfischer / products_controller.rb
Last active Feb 9, 2016
Tests for ProductsController
View products_controller.rb
class ProductsController < ApplicationController
before_action :set_product, only: [:show, :edit, :update, :destroy]
load_and_authorize_resource :except => [:index, :show]
respond_to :json, :html
# GET /products
# GET /products.json
def index
if ENV['RAILS_ENV'] == "production"
if params[:q]