Skip to content

Instantly share code, notes, and snippets.

View zgulde's full-sized avatar

Zach Gulde zgulde

View GitHub Profile

Deploying A Spring Boot Application

Changes To Your Application

  1. Allow the application to be packaged as a war

    In the pom.xml, change packaging from jar to war

    Change your class with a main method so that it extends SpringBootServletInitializer, and add the following method:

@zgulde
zgulde / day1.md
Last active February 6, 2017 15:17

Mac 101

  • two finger click == right click
  • finder: file explorer
  • home folder: Where all of your files live
    • Documents, Downloads, Desktop, etc are in here
    • vagrant-lamp directory is in here
    • when you open a terminal you will be here

keyboard shortcuts

  1. The following code block is syntactically correct, but will not produce the desired output. What can you change to fix this?

    function sayHello() {
      console.log('Hello, ' + name + '!');
    }
    
    sayHello("Zach");

// desired output: "Hello, Zach!"

#!/bin/bash
# This script will replace the ansible parts of the codeup vagrant setup
#
# bash -c "$(curl https://gist.githubusercontent.com/zgulde/2ba2d5ed67fcb58dca35305bc8be8b76/raw/2f451faba1913535c724b586598fafd62254e2cc/php-update.sh)"
set -e
if [[ ! -d ~/vagrant-lamp ]]; then
echo "~/vagrant-lamp directory not found!"

Transfer a file to a remote server (note that you need to have access to the remote server to do this)

scp <your-local-file> <user>@<ip-address>:<destination-directory>

Examples

Copy a file to the server

Github Pages Personal Site

  1. Create a new site

    # from ~/vagrant-lamp
    ansible-playbook ansible/playbooks/vagrant/site/php.yml
    

name it personal-site.dev

@zgulde
zgulde / pretty-colors.php
Created July 28, 2017 03:11
Pretty printed console output
<?php
/*
* colorize and individual color functions adapted from
* https://kpumuk.info/ruby-on-rails/colorizing-console-ruby-script-output/
* see also http://misc.flogisoft.com/bash/tip_colors_and_formatting
*/
function colorize($text, $code, $bold) {
$preamble = "\033";
@zgulde
zgulde / ConsoleLogger.php
Created July 28, 2017 03:16
Pretty printer for console messages
<?php
class ConsoleLogger {
private $bold = true;
public function __construct($bold = true) {
$this->bold = $bold;
}
public function info($msg) {

Arrays Review

Given the following code:

var myArray = [1, 2, 3, 4, 5];
  1. What is the element at index 0?
@zgulde
zgulde / git.md
Last active October 25, 2017 19:36