This file contains hidden or 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
insert into hero(name) values('Ms Nice'); | |
insert into hero(name) values('Yes Man'); | |
insert into hero(name) values('Bombastico'); | |
insert into hero(name) values('Fennel'); | |
insert into hero(name) values('Magnostic'); | |
insert into hero(name) values('Duck Man'); | |
insert into hero(name) values('Silly Putty Man'); | |
insert into hero(name) values('Company Man'); |
This file contains hidden or 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.navan.heroesbackend; | |
import org.springframework.data.jpa.repository.Query; | |
import org.springframework.data.repository.CrudRepository; | |
import org.springframework.data.repository.query.Param; | |
import org.springframework.data.rest.core.annotation.RestResource; | |
public interface HeroRepository extends CrudRepository<Hero, Long> { | |
@RestResource(path = "name", rel="name") | |
@Query("from Hero h where lower(h.name) like CONCAT('%', lower(:contains), '%')") |
This file contains hidden or 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
@Entity | |
public class Hero { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Long id; | |
private String name; | |
public Long getId() { |
This file contains hidden or 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
buildscript { | |
ext { | |
springBootVersion = '1.5.9.RELEASE' | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") | |
} |
This file contains hidden or 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
docker rm -vf $(docker ps -a -q) |
This file contains hidden or 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
' Alt-F11 in Word to get into VBA mode | |
' Then Insert>>Module | |
' Paste this in and Run | |
Public Sub CreateOutline() | |
Dim docOutline As Word.Document | |
Dim docSource As Word.Document | |
Dim rng As Word.Range | |
Dim astrHeadings As Variant |
This file contains hidden or 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
walls = [2,5,1,2,3,4,7,7,6] | |
# array of max values of elements to the left for each element | |
def running_max(_walls) | |
maxmin = 0 | |
_walls.inject([]) do |maxes, c| | |
maxes << if (c < maxmin) then | |
maxmin | |
else | |
maxmin = c |
This file contains hidden or 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
doskey subl="C:\Program Files\Sublime Text 2\sublime_text.exe" $* |
This file contains hidden or 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.upto(100).each do |x| | |
s = "" | |
s+= 'fizz' if (x % 3 == 0) | |
s += 'buzz' if (x % 5 == 0) | |
s = x.to_s if (s.empty?); | |
puts s | |
end |
This file contains hidden or 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 ca.ontario.moh.stix.loadfile; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
/** | |
* Decrypt file using 7zip | |
* | |
*/ |