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
@Entity | |
public class Project { | |
@GeneratedValue | |
@Id | |
private int id; | |
@Column | |
private String name; | |
public int getId() { |
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
<?php | |
$source_url = 'http://blog.mloza.pl'; | |
$url = "http://api.facebook.com/restserver.php?method=links.getStats&urls=".urlencode($source_url); | |
$xml = file_get_contents($url); $xml = simplexml_load_string($xml); | |
$shares = $xml->link_stat->share_count; // Liczba share | |
$likes = $xml->link_stat->like_count; // Liczba like | |
$comments = $xml->link_stat->comment_count; // Liczba komentarzy | |
$total = $xml->link_stat->total_count; // Sumarycznie | |
?> |
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
tar rjvf nazwa_archiwum.tar plik_do_dodania | |
tar ujvf nazwa_archiwum.tar.bz2 katalog/ |
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
int numLetters = switch (day) { | |
case MONDAY, FRIDAY, SUNDAY -> 6; | |
case TUESDAY -> 7; | |
case THURSDAY, SATURDAY -> 8; | |
case WEDNESDAY -> 9; | |
}; |
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
public class TextBlocksConcatenation { | |
public static void main(String[] args) { | |
String title = "Hello title"; | |
String header = "Hello header"; | |
System.out.println(""" | |
<html> | |
<head> | |
<title>""" + title + """ | |
</title> |
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
String formatted = | |
switch (obj) { | |
case Integer i -> String.format("int %d", i); | |
case Byte b -> String.format("byte %d", b); | |
case Long l -> String.format("long %d", l); | |
case Double d -> String.format("double %f", d); | |
case String s -> String.format("String %s, s); | |
default -> String.format("Object %s", obj); | |
}; |
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
#!/bin/bash | |
if [ -z "${CODEBUILD_RESOLVED_SOURCE_VERSION:-}" ]; then | |
{ | |
echo "Error: CODEBUILD_RESOLVED_SOURCE_VERSION is not set" | |
} >&2 | |
exit 1 | |
else | |
echo "Resolved hash: ${CODEBUILD_RESOLVED_SOURCE_VERSION}" | |
fi |
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
@EnableAutoConfiguration | |
@ComponentScan | |
@EnableJpaRepositories(basePackageClasses = TaskRepository.class) | |
public class Main { | |
public static void main(String[] args) { | |
SpringApplication.run(Main.class, args); | |
} | |
} |
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
@Service | |
public class HelloService { | |
public String getHello() { | |
return "World"; | |
} | |
} |
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
@SpringBootApplication | |
@Controller | |
public class Main { | |
@RequestMapping("/") | |
@ResponseBody | |
public String mainPage() { | |
return "Hello World!"; | |
} |
OlderNewer