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 | |
| function solve($arr): Iterator | |
| { | |
| foreach($arr as $k => $v){ | |
| $x = $arr; | |
| unset($x[$k]); | |
| yield array_product($x); // use generator for better memory usage | |
| } | |
| } |
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 | |
| function rgb(int $r, int $g, int $b): string { | |
| return vsprintf('#%02X%02X%02X', array_map(function ($v) { return min(max($v, 0), 255); }, [$r, $g, $b])); | |
| } | |
| // echo rgb(255,255,255) == #FFFFFF |
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 | |
| namespace Celyes\Proxy; | |
| final class Tor | |
| { | |
| private $curl; | |
| private $url; | |
| private $address; |
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
| using System; | |
| namespace test | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.Title = "Welcome to the program"; | |
| Console.Write("Value of X : "); |
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
| // Select color input | |
| // Select size input | |
| // When size is submitted by the user, call makeGrid() | |
| (() => { | |
| let inputWidth = document.querySelector('#inputWidth'), | |
| inputHeight = document.querySelector('#inputHeight'), | |
| colorPicker = document.querySelector('#colorPicker'), | |
| pixelCanvas = document.querySelector('#pixelCanvas'); |
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
| // Code by : Ilyes Chouia | |
| const caesarDecrypt = (cipher, shift) => { | |
| let output = ""; | |
| for(let i = 0; i < cipher.length; i++) { | |
| // الحصول على رمز لوحة المفاتيح لكل حرف من النص | |
| let cipherCode = cipher.charCodeAt(i); | |
| if(cipherCode >= 97 && cipherCode <= 122) { |
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
| // Code by : Ilyes Chouia | |
| const caesarShift = (text) => { | |
| // الحروف مقسمة على مصفوفة ليتم البحث فيها | |
| let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
| let output; | |
| // التحقق ما إذا كانت الاحرف الاستهلالية كبيرة | |
| text === text.toUpperCase() ? isUpperCase = true : isUpperCase = false; | |
| // التحقق ما إذا كان النص مكتوب بأحرف استهلالية فتم قلبه أو إبقاءه كما هو | |
| text === text.toUpperCase() ? text = text.toLowerCase(): text; |
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
| // Code by : Ilyes Chouia | |
| const caesar = (text, shift) => { | |
| // التحقق من أن الأحرف كبيرة أو لا | |
| text === text.toUpperCase() ? isUpperCase = true : isUpperCase = false; | |
| // تحويل الحروف الكبيرة إلى حروف صغيرة إن وجدت | |
| text === text.toUpperCase() ? text = text.toLowerCase(): text = text; | |
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 | |
| class Upload{ | |
| private $name; | |
| private $tmp_name; | |
| private $size; | |
| private $type; | |
| private $ext; | |
| private $allowed; |
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 recursive(n): | |
| if n == 0: | |
| return 0 | |
| elif n == 1: | |
| return 1 | |
| else : | |
| return n * recursive(n-1) |