Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
<?php
if(stristr($_SERVER['HTTP_USER_AGENT'], "Mobile")){ // if mobile browser
?>
        <link rel="stylesheet" href="style-400.css" type="text/css" />
<?php
} else { // desktop browser
?>
        <link rel="stylesheet" href="style.css" type="text/css" />
<?php
}
?>
by Valeri Tandilashvili
4 years ago
0
CSS
responsive design
4
several ways to put space between table rows CODE
fThe First way is to use
border-spacing
property
table {
    border-collapse:separate;
    border-spacing:0 15px;
}
Another way is to put additional separator TRs
<tr class="separator" />
between rows
.separator {
    height: 10px;
}
Third way is to use
margin-bottom
property
tr { 
    display: block;
    margin-bottom: 15px;
}
by Valeri Tandilashvili
4 years ago
2
CSS
table
4
If we want to commit only part of changes of the same file
--patch
or
-p
is used
git add --patch
Similar to the above command
git add -p
Possible answers for the command:
y
stage this hunk for the next commit
n
do not stage this hunk for the next commit
q
quit; do not stage this hunk or any of the remaining hunks
a
stage this hunk and all later hunks in the file
d
do not stage this hunk or any of the later hunks in the file ... The complete list of the possible answers is on the link of the note
by Valeri Tandilashvili
4 years ago
0
Git
4
this command changes all
.txt
extension to
.php
ren *.txt *.php
by გიორგი უზნაძე
4 years ago
0
CMD
4
set footer background after only scroll down event
Sets background image only when a user scrolls down (not to load every image at first)
document.addEventListener("scroll", setBG);
function setBG() {
    if (!bgSet) {
        var bgSet=1;
        id('table_footer').style.background='url(/images/footer.jpg?tg)';
        document.removeEventListener("scroll", setBG);
        console.log('fired');
    }
}
by Valeri Tandilashvili
4 years ago
0
JavaScript
4
Meeting 1
PHP Variables https://learning.applications.ge/note/public/3278 https://www.sololearn.com/learning/1059/1797/3456/1 https://www.w3schools.com/php/php_variables.asp https://www.javatpoint.com/php-variables https://www.tutorialrepublic.com/php-tutorial/php-variables.php Arithmetic Operators https://learning.applications.ge/note/public/3293 https://www.sololearn.com/learning/1059/1803/3469/1 https://www.w3schools.com/php/php_operators.asp Assignment Operators https://learning.applications.ge/note/public/3294 https://www.sololearn.com/learning/1059/1804/3472/1 https://www.w3schools.com/php/php_operators.asp Comparison Operators https://learning.applications.ge/note/public/3295 https://www.sololearn.com/learning/1059/1805/3503/1 https://www.w3schools.com/php/php_operators.asp Rules to create PHP variable https://learning.applications.ge/note/public/3277 https://www.roseindia.net/tutorial/php/phpbeginners/PHPvariable.html Case Sensitivity https://learning.applications.ge/note/public/3283 https://tutorialsclass.com/faq/is-php-a-case-sensitive-language/ PHP Comments https://learning.applications.ge/note/public/3279 https://www.sololearn.com/learning/1059/1795/3453/1 https://www.w3schools.com/php/php_comments.asp https://www.javatpoint.com/php-comments https://www.phptutorial.net/php-tutorial/php-comments/ echo / print https://learning.applications.ge/note/public/3280 https://www.sololearn.com/learning/1059/1794/3450/1 https://www.w3schools.com/php/php_echo_print.asp https://www.javatpoint.com/php-echo https://www.javatpoint.com/php-print https://www.tutorialrepublic.com/php-tutorial/php-echo-and-print-statements.php Differences between echo and print https://learning.applications.ge/note/public/3281 https://www.javatpoint.com/php-echo-and-print-statements Variable types https://learning.applications.ge/note/public/3282 https://www.sololearn.com/learning/1059/1796/3501/1 https://www.w3schools.com/php/php_datatypes.asp https://www.tutorialspoint.com/php/php_variable_types.htm https://www.javatpoint.com/php-data-types https://www.phptutorial.net/php-tutorial/php-data-types/ https://www.tutorialrepublic.com/php-tutorial/php-data-types.php Array types https://learning.applications.ge/note/public/3286 https://www.sololearn.com/learning/1059/1807/3476/1 https://www.sololearn.com/learning/1059/1808/3504/1 https://www.sololearn.com/learning/1059/1809/3505/1 https://www.w3schools.com/php/php_arrays.asp https://www.tutorialspoint.com/php/php_arrays.htm https://www.phptutorial.net/php-tutorial/php-array/ https://www.phptutorial.net/php-tutorial/php-associative-arrays/ https://www.phptutorial.net/php-tutorial/php-multidimensional-array/ https://www.tutorialrepublic.com/php-tutorial/php-arrays.php String functions https://learning.applications.ge/note/public/3284 https://www.w3schools.com/php/php_string.asp https://www.tutorialrepublic.com/php-tutorial/php-strings.php Math functions https://learning.applications.ge/note/public/3285 https://www.w3schools.com/php/php_math.asp If statement https://learning.applications.ge/note/public/3287 https://www.w3schools.com/php/php_if_else.asp https://www.tutorialspoint.com/php/php_decision_making.htm https://www.phptutorial.net/php-tutorial/php-if/ https://www.tutorialrepublic.com/php-tutorial/php-if-else-statements.php If-else statement https://learning.applications.ge/note/public/3288 https://www.sololearn.com/learning/1059/1823/3515/1 https://www.phptutorial.net/php-tutorial/php-if-else/ Else-if statement https://learning.applications.ge/note/public/3289 https://www.sololearn.com/learning/1059/1824/3517/1 https://www.phptutorial.net/php-tutorial/php-if-elseif/ Logical Operators https://learning.applications.ge/note/public/3305 https://www.sololearn.com/learning/1059/1806/3474/1 https://www.w3schools.com/php/php_operators.asp User defined functions https://learning.applications.ge/note/public/3290 https://www.sololearn.com/learning/1059/1834/3540/1 https://www.sololearn.com/learning/1059/1835/3542/1 https://www.w3schools.com/php/php_functions.asp https://www.tutorialspoint.com/php/php_functions.htm https://www.phptutorial.net/php-tutorial/php-function/ https://www.tutorialrepublic.com/php-tutorial/php-functions.php Loops https://learning.applications.ge/note/public/3291 https://www.sololearn.com/learning/1059/1826/3521/1 https://www.w3schools.com/php/php_looping.asp https://www.tutorialspoint.com/php/php_loop_types.htm https://www.phptutorial.net/php-tutorial/php-for-loop/ https://www.tutorialrepublic.com/php-tutorial/php-loops.php The break statement https://learning.applications.ge/note/public/3316 https://www.w3schools.com/php/php_looping_break.asp The continue statement https://learning.applications.ge/note/public/3317 https://www.sololearn.com/learning/1059/1831/3531/1 https://www.w3schools.com/php/php_looping_break.asp Main resources to learn PHP basics: https://www.php.net/ (official doc) https://www.sololearn.com/learning/1059 https://www.w3schools.com/php/ https://www.phptutorial.net/ https://www.tutorialrepublic.com/php-tutorial/ https://www.tutorialspoint.com/php/ https://www.javatpoint.com/php-tutorial PHP online editors: https://onlinephp.io/ https://www.writephponline.com/ https://www.mycompiler.io/new/php
by Valeri Tandilashvili
2 years ago
0
PHP
4
PHP else-if statement CODE
The code will output "Have a nice weekend!" if the current day is Friday, and "Have a nice Sunday!" if the current day is Sunday, otherwise it will output "Have a nice day!"
$d = date("D");
if($d == "Fri"){
    echo "Have a nice weekend!";
} elseif($d == "Sun"){
    echo "Have a nice Sunday!";
} else{
    echo "Have a nice day!";
}
echo "\n";
Outputs
Have a good morning!
if the current time is less than 10, and
Have a good day!
if the current time is less than 20. Otherwise it will output
Have a good night!
$t = date("H");
if ($t < "10") {
	echo "Have a good morning!";
} elseif ($t < "20") {
	echo "Have a good day!";
} else {
	echo "Have a good night!";
}
Prints
Adult
If
$age
is more than
18
, and
Teenager
if the variable is less than 12. Otherwise it prints
Child
$age = 20;
if ($age > 18) {
    echo 'Adult';
} else if ($age > 12) {
    echo 'Teenager';
} else {
    echo 'Child';
}
by Valeri Tandilashvili
2 years ago
0
PHP
4
PHP If statement CODE
If the current day is Friday the code will output "Have a nice weekend!" PHP datetime format: https://www.php.net/manual/en/datetime.format.php
$d = date("D");
if ($d == "Fri"){
    echo "Have a nice weekend!";
}
If the current hour is less than 20, the code will output "Have a good day!"
$t = date("H");
if ($t < "20") {
  echo "Have a good day!";
}
If
$age
is more than
18
, prints
Adult
$age = 20;
if ($age > 18) {
	echo 'Adult';	
}
by Valeri Tandilashvili
2 years ago
0
PHP
If / else
4
Array types CODE
Indexed array
$colors = ["Red", "Green", "Blue"];
$colors[] = "Yellow";
Associative arrays
$student = [
	"name"=>"George", 
	"weight"=>77, 
	"height"=>1.8, 
	"male"=>true
];
$student["male"] = true;
echo 'George is ' . $student['weight'] . 'kg'."\n";
Multidimensional arrays
$students = [
	"George"=> [
		"name"=>"George", 
		"weight"=>77, 
		"height"=>1.8, 
		"male"=>true
	],
	"Alex"=> [
		"name"=>"Alex", 
		"weight"=>87, 
		"height"=>2.8, 
		"male"=>true,
		"parents"=> [
			"father"=>"David",
			"mother"=>"Marta",
		]
	],
	
];
echo 'Alex weighs ' . $students['Alex']['weight'] . 'kg'."\n";
echo "Alex's father is: " . $students['Alex']['parents']['father'];
by Valeri Tandilashvili
2 years ago
0
PHP
4
Functions don't need to be defined before they are called. In this example, function
printMe()
is defined after it's called but it works without errors
echo printMe();

function printMe() {
    return 'Print some text';
}
Exception is
conditional function
. In this example function
foo()
will not be defined until the
if ($makefoo)
conditional statement gets executed
$makefoo = true;

/* We can't call foo() from here 
   since it doesn't exist yet,
   but we can call bar() */
// foo();

bar();

if ($makefoo) {
  function foo()
  {
    echo "I don't exist until program execution reaches me.\n";
  }
}

/* Now we can safely call foo()
   since $makefoo evaluated to true */

if ($makefoo) foo();

function bar() 
{
  echo "I exist immediately upon program start.\n";
}
Functions within functions. Function
bar()
will not be defined until the function
foo()
is executed
function foo() 
{
  function bar() 
  {
    echo "I don't exist until foo() is called.\n";
  }
}

/* We can't call bar() yet
   since it doesn't exist. */
// bar();


foo();

/* Now we can call bar(),
   foo()'s processing has
   made it accessible. */

bar();
Note: All functions in PHP have the global scope - they can be called outside a function even if they were defined inside and vice versa
by Valeri Tandilashvili
4 years ago
0
PHP
PHP official doc
4
Results: 1580