Skip to content

Instantly share code, notes, and snippets.

@thdtt
thdtt / script.js
Created October 26, 2020 08:28 — forked from zzNuAzz/script.js
kiểm thử tool
function get() {
return new Promise((resolve, reject) => {
fetch('https://gist.githubusercontent.com/zzNuAzz/645bc20f12d7a04bd593bc14fc01be42/raw/e4ad40db0d6c1dac9315588f92699e17c2e0e7c4/kiemthu.json') // Call the fetch function passing the url of the API as a parameter
.then(data => data.json())
.then(data => resolve(data))
.catch(() => reject());
});
}
function sleep(ms) {
@thdtt
thdtt / kiemthu.json
Created October 26, 2020 08:28 — forked from zzNuAzz/kiemthu.json
trắc nghiệm kiểm thử
[
{
"question": "Kỹ thuật được áp dụng để kiểm tra khả năng sử dụng là?",
"right": "Hộp đen"
},
{
"question": "{{Thẩm tra || Verification}} là quá trình đánh giá phần mềm có đáp ứng các yêu cầu được thiết lập trong giai đoạn trước hay không.",
"right": null
},
{
let jspdf = document.createElement("script");
const name = document.getElementsByClassName('a-b-K-T a-b-cg-Zf').item(0).innerHTML;
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName("img");
for (let i in elements) {
let img = elements[i];
console.log("add img ", img);
if (!/^blob:/.test(img.src)) {
@thdtt
thdtt / pom.xml
Created March 16, 2021 15:46
JCIA pom.xml file
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fit</groupId>
<artifactId>jcia</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>jcia Maven Webapp</name>
public static CompilationUnit getJdtRoot(String javaFilePath, String sourceFolder) throws IOException {
ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setResolveBindings(true);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setBindingsRecovery(true);
Map options = JavaCore.getOptions();
parser.setCompilerOptions(options);
git log --shortstat --author $1 --since "10 years ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
@thdtt
thdtt / CorsConfig.java
Created April 11, 2021 14:38
Cors Configuration in Spring Boot Backend Projects
@Configuration
public class CorsConfig {
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE").allowedOrigins("*")
.allowedHeaders("*");
package com.example.restapi.util;
import com.example.restapi.model.User;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Date;
@thdtt
thdtt / quora-toxic-question.ipynb
Last active May 6, 2021 11:07
[Machine-Learning] Toxic Question.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.