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
| public class LinearSearch { | |
| public static int linearSearch(String[] haystack, String needle) { | |
| for (int i = 0; i < haystack.length; i++) { | |
| if (needle.equals(haystack[i])) { | |
| return i; | |
| } | |
| } | |
| return -1; | |
| } |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Delete Form</title> | |
| </head> | |
| <body> | |
| <delete-form> | |
| <form action="/widgets/1/delete" method="post"> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>HTML</title> | |
| </head> | |
| <body> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Kieran Barker</title> | |
| </head> | |
| <body> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>XSS</title> | |
| </head> | |
| <body></body> | |
| <script> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Users</title> | |
| </head> | |
| <body> | |
| <h1>Users</h1> | |
| <p>Check the JavaScript console.</p> |
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
| const { inspect } = require('util'); | |
| const restaurants = [ | |
| { | |
| name: 'Nando\'s', | |
| menus: { | |
| starters: [ | |
| { name: 'Halloumi Sticks & Dip', price: 425 }, | |
| { name: 'Houmous with PERi-PERi Drizzle', price: 425 }, | |
| { name: 'Sweet Potato Wedges with Garlic PERinaise', price: 425 } |
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
| /** | |
| * Get today's date. | |
| * https://gist.github.com/kieranbarker/2c300d73059697a4417e12bd40cdef75 | |
| * @returns {Date} A Date object representing today's date at midnight in UTC. | |
| */ | |
| function getTodaysDate() { | |
| const dateString = new Date().toISOString().slice(0, 10); | |
| return new Date(dateString); | |
| } |
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
| import * as fs from 'fs'; | |
| import * as fsPromises from 'fs/promises'; | |
| const file = 'hello_world.txt'; | |
| const data = 'Hello, World!'; | |
| // | |
| // Callback API | |
| // |
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
| { | |
| "name": "read_write", | |
| "version": "1.0.0", | |
| "description": "Asynchronously read and write files.", | |
| "private": true, | |
| "main": "read_write.js", | |
| "type": "module", | |
| "scripts": { | |
| "start": "node read_write.js", | |
| "test": "echo \"Error: no test specified\" && exit 1" |
NewerOlder