-
list all local users
cut -d: -f1 /etc/passwd
-
list users and their permissions
cat /etc/passwd
-
list groups
cat /etc/groups
View commands.md
View main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
View config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
View answers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #1 | |
String.prototype.repeatify = function(num) { | |
var repeated_str = ''; | |
for (var i = 0; i < num; i++) { | |
repeated_str = repeated_str + this; | |
} | |
return repeated_str; |
View friendlyDates.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
View products_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
View cat.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 + "!" |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |