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 os | |
| def find_files(directory, pattern): | |
| for item in os.listdir(directory): | |
| full_path = os.path.join(directory, item) | |
| if os.path.isfile(full_path) and pattern in item: | |
| print(full_path) | |
| elif os.path.isdir(full_path): | |
| find_files(full_path, pattern) # Recurse into subdirectory | |
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 reverse_string(s): | |
| if len(s) == 0: | |
| return s | |
| else: | |
| return reverse_string(s[1:]) + s[0] | |
| print(reverse_string("hello")) # Output: olleh |
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 fibonacci(num): | |
| if num<= 1: | |
| return num | |
| else: | |
| return fibonacci(num-1) + fibonacci(num-2) | |
| print(fibonacci(6)) # Output: 8 |
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 factorial(num): | |
| # Base case | |
| if num == 0: | |
| return 1 | |
| # Recursive step | |
| else: | |
| return num * factorial(num - 1) | |
| print(factorial(3)) # Output: 6 |
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 { | |
| AddStreamOptions, | |
| ConstructorOptions, | |
| VideoStreamMerger | |
| } from "video-stream-merger"; | |
| import { RecordRTCPromisesHandler } from "recordrtc"; | |
| import { ScreenShare } from "@components/ScreenShareOption"; | |
| // This just renames it to StreamSettings because it gives you a better idea of what it is. | |
| // eslint-disable-next-line @typescript-eslint/no-empty-interface |
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 | |
| define('MAILGUN_URL', 'https://api.mailgun.net/v3/YOUR_URL'); | |
| define('MAILGUN_KEY', 'MAILGUN_KEY'); | |
| $mail = $_POST; | |
| $name = $mail['name']; | |
| $from = $mail['email']; | |
| if(empty($from) || empty($name)) { | |
| print('false'); |
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
| export interface StudentProps { | |
| id: number; | |
| name: string; | |
| } | |
| export interface TeacherProps { | |
| id: number; | |
| name: string; | |
| isGoodTeacher: boolean; | |
| } |
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
| interface StudentProps { | |
| id: number; | |
| name: string; | |
| } | |
| export class Student { | |
| constructor(private data: StudentProps) {} | |
| get(propName: string): number | string { |
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 rootUrl = "https://path_to_your_server/students"; | |
| class Student { | |
| public sync: Sync<StudentProps> = new Sync<StudentProps>(rootUrl) | |
| } | |
| interface HasId { | |
| id?: number; | |
| } |
NewerOlder