Skip to content

Instantly share code, notes, and snippets.

View krcrawford's full-sized avatar

Kyle Crawford krcrawford

  • McKinney, TX, USA
View GitHub Profile
@krcrawford
krcrawford / .vimrc
Last active January 20, 2019 14:19
A rolling copy of my .vimrc file
" Basic configuration.
set nomodeline " for security reasons
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@krcrawford
krcrawford / .tmux.conf
Created November 17, 2016 21:34
A rolling copy of my tmux configuration
## Status bar design
# status line
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2
# messaging
set -g message-fg black
set -g message-bg yellow
@krcrawford
krcrawford / song.js
Created March 4, 2019 14:25
Javascript Homework #1
// attributes of a song
// song
const song = {
// artist
artist: {
firstName: 'Herbie',
lastName: 'Hancock',
},
title: 'Stars in Your Eyes',
@krcrawford
krcrawford / variables.js
Last active March 4, 2019 17:11
Javascript Homework #2
/**
*
* Hoisting...
*
* In es5 and es6 variables are hoisted. This means that the interpreter
* parses files or code for variable declarations and moves them to the
* top of the top of their respective scopes, or "hoists" them.
* Variables are declared automatically, but may or may not be initialized
* based on how the user wites their code. Initially, any variable that is not
* assigned is given the default value of `undefined`, i.e typeof === 'undefined'.
@krcrawford
krcrawford / statements-and-operators.js
Last active March 4, 2019 16:42
Javascript Homework #3
/**
* All men are mortal
* Socrates is a man.
* Therefore, socrates is mortal.
*/
const Man = function(name) {
this.name = name;
};
@krcrawford
krcrawford / functions.js
Last active March 5, 2019 14:27
Javascript Homework #4
/**
* All men are mortal
* Socrates is a man.
* Therefore, socrates is mortal.
*/
const Man = function(name) {
this.name = name;
}
@krcrawford
krcrawford / time-adder.js
Created March 6, 2019 17:23
Javascript Homework #5
const timeAdder = (value1, label1, value2, label2) => {
if (typeof value1 !== "number" || typeof value2 !== "number") {
console.log("Values must be numbers");
return false; // must be numbers
}
if (/\./.test(value1) || /\./.test(value2)) {
console.log("Values must be integers");
return false; // must be integers
}
if (value1 < 0 || value2 < 0) {
@krcrawford
krcrawford / fizzbuzz.js
Created March 6, 2019 21:28
Javascript Homework #6
const fizzbuzz = () => {
let index = 0, max = 100, log = '';
const initialPrimes = [2, 3, 5, 7, 11];
for (; index < max; index++) {
if ((index !== 1 && initialPrimes.indexOf(index) !== -1) ||
(index !== 1 &&
index % 2 !== 0 &&
index % 3 !== 0 &&
index % 5 !== 0 &&
index % 7 !== 0)) {
@krcrawford
krcrawford / dom.html
Last active March 7, 2019 12:20
Javascript Homework #7
<html>
<head>
<title>DOM Homework Page</title>
<style>
#rectangleWrapper {
padding-top: 50px;
padding-left: 50px;
padding-right: 50px;
padding-bottom: 0;
}
@krcrawford
krcrawford / tic-tac-toe.html
Last active March 7, 2019 15:46
Javascript Homework #8 HTML
<html>
<head>
<title>Tic-Tac-Toe</title>
<script src="tic-tac-toe.js"></script>
<link rel="stylesheet" type="text/css" href="tic-tac-toe.css">
</head>
<body>
<h1>Tic-Tac-Toe</h1>
<div id="board">
<div class="row">