Skip to content

Instantly share code, notes, and snippets.

View tounsils's full-sized avatar
🏆
Focusing

Ilyes Tounsi tounsils

🏆
Focusing
View GitHub Profile
@tounsils
tounsils / ReactJs-InterviewQuestions.md
Last active October 8, 2021 03:31
ReactJs Interview Questions
  1. What is React?

Answer: React is a Javascript Library which is used for building user interfaces. ReactJs is used as a base of a single webpage or mobile applications. It deals in the view layer of an application.

  1. What is JSX?

Answer: JSX is simple JavaScript which allows HTML syntax and other HTML tags in the code. HTML syntax is processed into javascript calls of React framework.

@tounsils
tounsils / SiteMaintenance.html
Last active July 21, 2019 22:26
Site Maintenance one html file
<!doctype html>
<link rel="shortcut icon" href="favicon.ico"/>
<title>TN76.com Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
The time will pass away, you can either spend it creating the life you want or spend it living the life you don’t want. The choice is yours.
@tounsils
tounsils / LeagueTable.php
Last active February 12, 2022 06:43
League Table
<?php
/**
* The LeagueTable class tracks the score of each player in a league. After each game, the player records their score with the recordResult function.
* The player's rank in the league is calculated using the following logic:
* The player with the highest score is ranked first (rank 1). The player with the lowest score is ranked last.
* If two players are tied on score, then the player who has played the fewest games is ranked higher.
* If two players are tied on score and number of games played, then the player who was first in the list of players is ranked higher.
* Implement the playerRank function that returns the player at the given rank.
* For example:
* $table = new LeagueTable(array('Mike', 'Chris', 'Arnold'));
@tounsils
tounsils / Symfony.rm
Created November 29, 2018 13:37
Symfony projects
https://github.com/gibsonneke/symfony-crud
@tounsils
tounsils / VowelsInSTR.php
Created November 8, 2018 13:32
Displays vowels and number of vowels in a string using regex
$str = "Created by PhpStorm.
* User: Tounsi
* Date: 30/10/2018
* Time: 11:59
*
* List of vowels in string";
$nbVowels = 0;
for($i=0;$i<strlen($str);$i++)
{
@tounsils
tounsils / Soduko_tester.php
Last active November 8, 2018 13:05
Function that tests if the suduko is solvedor no
<?php
/**
* Created by PhpStorm.
* User: Tounsi
* Date: 30/10/2018
* Time: 11:59
*/
Function used_in_row($grid, $row, $num)
{
@tounsils
tounsils / Sudoku_solver_working.php
Created November 7, 2018 13:31
Sudoku Solver working 100%
<?php
/**
* Created by PhpStorm.
* User: PC16
* Date: 02/11/2018
* Time: 16:17
*/
class Sudoku {
private $comming_arr = array();
@tounsils
tounsils / Sudoku_easy.php
Last active November 7, 2018 13:29
Sudoku for easy case
<?php
/**
* Created by PhpStorm.
* User: PC16
* Date: 30/10/2018
* Time: 11:59
*/
//var $grid;
Function get_unassigned_location($grid)
@tounsils
tounsils / power_of_two.php
Last active August 10, 2021 13:20
Write a PHP program to check if a given positive integer is a power of two.
<?php
/**
* Write a PHP program to check if a given positive integer is a power of two.
* Input : 4
*
*
* Example (positive):
* n = 32
* than in binary representation