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
package io.singh1114.springboottut.school; | |
import javax.persistence.*; | |
@Entity | |
public class School { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name="id") |
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
package io.singh1114.springboottut.school; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
@RestController | |
public class SchoolController { |
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
--- | |
layout: default | |
--- | |
<article class="post"> | |
<h1>{{ page.title }}</h1> | |
<div class="date"> | |
Written on {{ page.date | date: "%B %e, %Y" }} | |
</div> |
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
... | |
<div class="entry"> | |
{% include share-bar.html %} | |
{% assign content_para = content | split: "<p>" %} | |
{% for para in content_para %} | |
{{para}} | |
{% assign para_number = forloop.index | modulo: 10 %} | |
{% if para_number == 0 %} | |
<h2>Your SPECIAL CODE</h2> | |
{% endif %} |
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
package io.singh1114.springboottut; | |
import io.singh1114.springboottut.school.School; | |
import io.singh1114.springboottut.school.SchoolRepository; | |
import org.json.JSONException; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.skyscreamer.jsonassert.JSONAssert; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; |
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
spring.datasource.url=jdbc:mysql://localhost:3306/springtestguide | |
spring.datasource.username=root | |
spring.datasource.password=<password> | |
spring.jpa.hibernate.ddl-auto=update |
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
package io.singh1114.springboottut; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.context.annotation.PropertySource; | |
@Configuration | |
@ComponentScan("io.singh1114.springboottut") | |
@Profile("test") |
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
<div class="linked_post"> | |
{% for post in site.posts %} | |
{% assign post_url = post.url | replace: "/", "" %} | |
{% if post_url == include.url %} | |
<div class="linked_post_div"> | |
<article class="post"> | |
<h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1> | |
<p style="color: #969494; margin: 10px 0px; font-size: 18px;"> | |
{{ post.date | date: "%B %e, %Y" }} | |
</p> |
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
{% include linked_post.html url="how-to-contribute-to-open-source-and-land-a-better-job" %} |