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
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Cau1 { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
// Nhập số phần tử của mảng, dùng vòng lặp while kiểm tra điều kiện, nếu nhập dưới hoặc bằng 3 sẽ chạy lại vòng lặp tới khi nào ta nhận được > 3 | |
int n = 0; | |
while (n <= 3) { |
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
export const toDateParse = (date, dateFormat = 'MM/dd/yyyy') => { | |
try { | |
return parse(date, dateFormat, new Date()); | |
} catch (e) { | |
return false; | |
} | |
}; |
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
$ids = [1, 2, 3, 4, 5]; | |
foreach($ids as $id) { | |
$total = Service::GetPrice($id, Auth::user()->role) * $data["amount"]; | |
if($total > Auth::) .... { | |
return "so du ko du"; | |
} | |
} |
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
[{"option1":"X-Large Premium Blanket","origin_price":true,"price":"65.50"},{"option1":"Large Premium Blanket","origin_price":true,"price":"60.50"},{"option1":"Youth Premium Blanket","origin_price":true,"price":"55.50"}] |
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
{ | |
"JNUG": { | |
"RSI": 56.14481391285456, | |
"h": [ | |
{ | |
"low": 138.33, | |
"high": 143.15, | |
"volume": 214366, | |
"open": 140.84, | |
"close": 140, |
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
// manifest.json | |
{ | |
"web_accessible_resources": ["data.txt"] // add this | |
} | |
// get | |
const url = chrome.runtime.getURL('data.txt'); //path to file | |
fetch(url) | |
.then(response => response.text()) |
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
const array = [ | |
{ | |
id: 1, | |
name: 'Monkey' | |
}, | |
{ | |
id: 2, | |
name: 'Lion' | |
}, | |
{ |
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
async function someFunction() { | |
const myArray = [1, 2, 3]; | |
const connection = mysql.createPool({ options }); | |
let finalArray = []; | |
myArray.forEach((value) => { // standard forEach | |
finalArray.push(asyncFunction(connection, value).then((result) => { | |
finalValue.asyncFunctionValue = result.asyncFunctionValue; // giving instructions | |
return finalValue; // important to return the value | |
})); | |
}); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<script | |
src="https://code.jquery.com/jquery-3.4.1.min.js" | |
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" | |
crossorigin="anonymous"></script> |