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
| function sqrt(number) { | |
| if (number < 0) { | |
| throw new Error("Square root of a negative number is undefined"); | |
| } | |
| let guess = number / 2; | |
| const precision = 0.0001; // Adjust the precision as needed | |
| while (Math.abs(guess * guess - number) > precision) { | |
| guess = (guess + number / guess) / 2; |
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
| invoice_id | id | product_id | price | paid_ammount | |
|---|---|---|---|---|---|
| INV000001 | 1 | 40 | 450 | 450 | |
| INV000002 | 2 | 50 | 5000 | 5000 | |
| INV000003 | 3 | 200 | 400 | 400 |
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
| id | product_id | price | paid_ammount | |
|---|---|---|---|---|
| 1 | 40 | 450 | 450 | |
| 2 | 50 | 5000 | 5000 | |
| 3 | 200 | 400 | 400 |
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
| { | |
| "object": "page", | |
| "id": "d745c7a0-aac2-4bc4-be52-df5e58737a1b", | |
| "created_time": "2023-04-23T19:08:00.000Z", | |
| "last_edited_time": "2023-04-23T19:08:00.000Z", | |
| "created_by": { | |
| "object": "user", | |
| "id": "98f69ff4-b3b5-4ddf-a707-a4aa36d444dc" | |
| }, | |
| "last_edited_by": { |
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
| function getRowNumberByValue() { | |
| const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1'); | |
| const searchValue = 'value to search for'; | |
| const dataRange = sheet.getRange('A:A'); | |
| const values = dataRange.getValues(); | |
| for (let i = 0; i < values.length; i++) { | |
| if (values[i][0] === searchValue) { | |
| const rowNumber = i + 1; | |
| Logger.log(`Found "${searchValue}" at row ${rowNumber}`); |
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
| // https://godoc.org/github.com/pkg/errors#Frame.Format | |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/pkg/errors" | |
| ) |
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
| def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', printEnd = "\r"): | |
| """ | |
| Call in a loop to create terminal progress bar | |
| @params: | |
| iteration - Required : current iteration (Int) | |
| total - Required : total iterations (Int) | |
| prefix - Optional : prefix string (Str) | |
| suffix - Optional : suffix string (Str) | |
| decimals - Optional : positive number of decimals in percent complete (Int) | |
| length - Optional : character length of bar (Int) |
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
| console.log('Hello World'); | |
| import satori from 'satori' | |
| import { SatoriOptions } from 'satori'; | |
| import * as fs from 'fs'; | |
| import SVGtoPDF from 'svg-to-pdfkit'; | |
| import PDFKit from 'pdfkit'; | |
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
| <?php | |
| use PhpCsFixer\Config; | |
| use PhpCsFixer\Finder; | |
| $rules = [ | |
| 'array_indentation' => true, | |
| 'array_syntax' => ['syntax' => 'short'], | |
| 'binary_operator_spaces' => [ | |
| 'default' => 'single_space', |
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
| // solution 1 | |
| func lengthOfLongestSubstring(s string) int { | |
| length := len(s) | |
| var result []string | |
| // fmt.Println(s[1:4]) |