Skip to content

Instantly share code, notes, and snippets.

Aaron amfische

Block or report user

Report or block amfische

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
@amfische
amfische / main.js
Created Apr 13, 2019
Karlas google apps script
View main.js
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
}
@amfische
amfische / config
Created Nov 7, 2018
Multiple SSH Keys Config file
View config
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
@amfische
amfische / main.js
Created May 19, 2017
Vue Tab Example
View main.js
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>
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
@amfische
amfische / 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;
@amfische
amfische / 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.
@amfische
amfische / 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 = arr.map(function(e) {
return (e == "x") ? e = "*" : (e == divideSymbol) ? e = "/" : e;
});
@amfische
amfische / 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
end
def feed(food)
puts "Mmmm, " + food + "!"
@amfische
amfische / 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]
@amfische
amfische / index.html
Last active Oct 13, 2015
CF Portfolio
View index.html
<!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>
You can’t perform that action at this time.