Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View amfischer's full-sized avatar

Aaron amfischer

View GitHub Profile
@amfischer
amfischer / commands.md
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
amfischer / main.js
Created April 13, 2019 23:29
Karlas google apps script
function course(seats, name) {
this.seats = seats
this.enrolled = 0
this.name = name
this.increment = function() {
this.enrolled++
}
this.isFull = function() {
return this.enrolled >= this.seats
}
@amfischer
amfischer / config
Created November 7, 2018 16:05
Multiple SSH Keys Config file
Host frontend[can use any name here] github.com
Hostname github.com
IdentityFile ~/.ssh/eagle-fe_rsa
Host backend[can use any name here] github.com
Hostname github.com
IdentityFile ~/.ssh/eagle-be_rsa
// generate ssh key: ssh-keygen -t rsa -b 4096 -C "your_email@example.com" [any phrase can go in quotes]
// make sure to paste public key into github
@amfischer
amfischer / main.js
Created May 19, 2017 19:58
Vue Tab Example
Vue.component('tabs', {
template: `
<div>
<div class="tabs">
<ul>
<li v-for="tab in tabs" :class="{ 'is-active': tab.isActive }">
<a :href="tab.href" @click="isSelected(tab)">{{ tab.name }}</a>
</li>
</ul>
</div>
@amfischer
amfischer / laravel-install.txt
Last active February 18, 2017 00:23
cheat sheets
# 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
amfischer / answers.js
Created February 10, 2017 02:09
Algorithm Challenges
// #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
amfischer / friendlyDates.js
Created September 28, 2016 21:48
FCC Algorithm Challenges
/*
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
amfischer / products_controller.rb
Last active February 9, 2016 02:35
Tests for ProductsController
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
amfischer / cat.rb
Last active February 9, 2016 02:19
Ruby Practice
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
def feed(food)
puts "Mmmm, " + food + "!"
@amfischer
amfischer / index.html
Last active October 13, 2015 22:35
CF Portfolio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Aaron's Portfolio</title>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="js/scripts.js"></script>