Skip to content

Instantly share code, notes, and snippets.

@chrisbay
chrisbay / .project
Created November 11, 2016 20:50
.project for spring-blogz
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>blogz-spring</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
@chrisbay
chrisbay / pom.xml
Created November 8, 2016 00:27
pom.xml for hello, spring application
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.launchcode</groupId>
<artifactId>hello-spring</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
@chrisbay
chrisbay / application.properties
Created November 8, 2016 00:26
application.properties for hello, spring app
# enable hot swapping
spring.thymeleaf.cache = false
# Database connection settings
spring.datasource.url=jdbc:mysql://localhost:3306/hello
spring.datasource.username=hello
spring.datasource.password=launchcode
# Specify the DBMS
spring.jpa.database = MYSQL
@chrisbay
chrisbay / application.properties
Created November 7, 2016 14:16
application.properties for Spring Blogz assignment
# Disable Thymeleaf caching for hot-swapping of templates
spring.thymeleaf.cache = false
# Database connection settings
spring.datasource.url=jdbc:mysql://localhost:3306/blogz
spring.datasource.username=blogz
spring.datasource.password=launchcode
# Specify the DBMS
spring.jpa.database = MYSQL
@chrisbay
chrisbay / gist:c8510b141fece941967c80abc6a3a208
Last active November 3, 2016 23:13
Print all beans found or provided by Spring Boot
@SpringBootApplication
public class MyApplication {

    public static void main(String[] args) {
        ApplicationContext ctx = SpringApplication.run(MyApplication.class, args);
        System.out.println("Beans provided or found by Spring Boot:");
        String[] beanNames = ctx.getBeanDefinitionNames();
        Arrays.sort(beanNames);
 for (String beanName : beanNames) {
@chrisbay
chrisbay / gist:3eef7aca409adbd0722552565899f19c
Created September 18, 2016 21:28
Bash commands for .bash_profile/.bash_rc to prepend prompt with random emoji
# generate random emoji for prompt
EMOJIS=(๐ŸŒฑ ๐ŸŒฒ ๐ŸŒณ ๐ŸŒด ๐ŸŒต ๐ŸŒฟ ๐Ÿ€ ๐Ÿ ๐Ÿ‚ ๐Ÿƒ ๐Ÿ‡ ๐Ÿˆ ๐Ÿ‰ ๐ŸŠ ๐Ÿ‹ ๐ŸŒ ๐Ÿ ๐ŸŽ ๐Ÿ ๐Ÿ ๐Ÿ‘ ๐Ÿ’ ๐Ÿ“ ๐Ÿ… ๐ŸŒฝ ๐ŸŒถ ๐Ÿ„ ๐Ÿง€ ๐ŸŒฎ ๐ŸŒฏ ๐Ÿฉ ๐Ÿช ๐Ÿฐ ๐Ÿซ ๐Ÿฌ ๐Ÿญ ๐Ÿฎ ๐Ÿท ๐Ÿธ ๐Ÿน ๐Ÿบ)
IDX=$(jot -r 1 0 ${#EMOJIS[@]})
EMOJI=${EMOJIS[IDX]}
export PS1="$EMOJI \[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\W\[\033[m\]\$ "