Skip to content

Instantly share code, notes, and snippets.


Aaron amfischer

View GitHub Profile
amfischer /
Last active May 20, 2022 15:27
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 April 13, 2019 23:29
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 November 7, 2018 16:05
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 19:58
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>
amfischer / laravel-install.txt
Last active February 18, 2017 00:23
cheat sheets
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 February 10, 2017 02:09
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 September 28, 2016 21:48
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 / products_controller.rb
Last active February 9, 2016 02:35
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]
amfischer / cat.rb
Last active February 9, 2016 02:19
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 / index.html
Last active October 13, 2015 22:35
CF Portfolio
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Aaron's Portfolio</title>
<script src=""></script>
<script src="js/scripts.js"></script>