Notepad++ select javascript content
Jak vybrat kód mezi taky v Notepad++
How to select f.e. javascript tag contetn in Notepad++
- insert content between braces
- put caret behind the last bracket
- press Ctrl + left Alt + B or Ctrl + Shift + B to control the first brace
from parentheses to braces and check the multi-line box.
Then you can Ctrl-double-click on either brace to highlight everything in between.
How to select f.e. javascript tag contetn in Notepad++
- insert content between braces
- put caret behind the last bracket
- press Ctrl + left Alt + B or Ctrl + Shift + B to control the first brace
< script>
{
var bla = 0;
// bla bla ... long content
} // place caret/cursor behind the last brace { and press Ctrl + left Alt + B (Notepad++)
< /script>
At Settings->Preferences->Delimiter, change the delimiters
from parentheses to braces and check the multi-line box.
Then you can Ctrl-double-click on either brace to highlight everything in between.
77LW NO topic_id
AD
Další témata ....(Topics)
Někdy potřebujeme získat url adresu pro menu, nebo odkazy atd.
pozor funkce je empty() a ne emptyempty
pozor funkce je empty() a ne emptyempty
$currentURL = (!empty($_SERVER['HTTPS']))
? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']
: "//".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
var 1_radian_to_degree = 180 / Math.PI; // 57,295779513082320876798154814105 degree
var 1_degree_to_radian = Math.PI / 180; // 0,01745329251994329576923690768489 radian
var 360_degree = 2 * Math.PI * 1_radian_to_degree;
var degree = 36.86;
var opposite = 600;
var hypotenuse = 1000;
var adjacent = 800;
// degree
// sin 45° == 0.7071067811865475;
var sin = Math.sin(45 * Math.PI / 180.0)
//sin == 0.7071067811865475;
// vypocet prepony (hypotenuse), kdyz zname
// protilehlou (opposite) a uhel (degree)
hypotenuse2 = opposite/ Math.sin(degree * Math.PI / 180.0);
// vypocet protilehle (opposite)
opposite2 = hypotenuse * Math.sin(degree * Math.PI / 180);
// vypocitat uhel alfa z velikosti protilehle a prepony ve stupnich (degree)
degree2 = Math.asin(opposite / hypotenuse)* (180/Math.PI); // 1rad
// velikost prepony pomoci prilehle (adjacent) strany a cos a uhlu v stupnich (degree)
hypotenuse3 = adjacent / Math.cos(degree * Math.PI / 180);
// velikost prilehle (adjacent) strany pomoci prepony a cos a uhlu v stupnich (degree)
adjacent2 = hypotenuse * Math.cos(degree * Math.PI / 180);
tan = Math.tan(degree * Math.PI/180); // 45° == 0.9999999999999
degree3 = Math.atan(opposite / adjacent)* (180/Math.PI); // 1rad
adjacent3 = opposite / Math.tan(degree * Math.PI / 180);
opposite3 = adjacent * Math.tan(degree * Math.PI / 180);
Jak získat obsah určité složky příklad v php.
/*************************
* vyhleda soubory s prislusnou koncovkou
* a vrátí nejmladsi soubor
* $extension
*/
function getFileFromDir($path, $extension)
{ // BEGIN function getFileFromDir
$fileReturn; $z = 0;
if (is_dir ($path)) {
$dh = opendir($path); // or die (" Directory Open failed !");
while ($file = readdir($dh)){
//print $file.'<br />';
if (is_file($path.$file)) {
//print $file.'<br />';
$ar = explode(".", $file);
if (count($ar) > 1) {
if (strtolower($ar[count($ar) - 1]) == $extension) { // "zip", "exe" or other extension
$fileReturn[$z][0] = date ("Ymd", filemtime($path.$file));
$fileReturn[$z][1] = $file;
$z++;
//break;
}
}
}
}
closedir ($dh);
}
if ($fileReturn) {
sort($fileReturn);
return $fileReturn[count($fileReturn) - 1][1];
}
} // END function getFileFromDir
/***************************
Ke konverzi diakritiky slouží v PHP mnoho funkcí, ale výsledky jsou různé.
Někdy je lepší si udělat vlastní funkci.
Níže uvedená funkce zamění v řetězci paznaky, za jejich čitelný ekvivalent:
Někdy je lepší si udělat vlastní funkci.
Níže uvedená funkce zamění v řetězci paznaky, za jejich čitelný ekvivalent:
/**
* konverze diakritiky - okhelp.cz
*/
function diakritika($vstup) {
$arMala = array('á'=> 'á', 'ÄŤ'=> 'č', 'ÄŹ'=> 'ď', 'Ă©'=> 'é', 'Ä›'=> 'ě',
'Ă'=> 'i', 'Ĺ'=> 'ň', 'Ăł'=> 'ó', 'Ĺ™'=> 'ř', 'š'=> 'š', 'ĹĄ'=> 'ť', 'Ăş'=> 'ú', 'ĹŻ'=> 'ů', 'Ă˝'=> 'ý', 'Ĺľ'=> 'ž' );
$arVelka = array('Ă'=> 'Á', 'Ä©'=> 'Č', 'Ĭ'=> 'Ď', 'É'=> 'É', 'ı'=> 'Ě',
'Ă«'=> 'Í', 'Ň'=> 'Ň', 'Ă"'=> 'Ó', 'Ĺ'=> 'Ř', 'Ĺ '=> 'Š', 'Ť'=> 'Ť', 'ñ'=> 'Ú', 'ĹŽ'=> 'Ů', 'ö'=> 'Ý', 'Ĺ˝'=> 'Ž' );
foreach ($arMala as $key=>$value) {
$vstup = str_replace($key, $value, $vstup);
}
foreach ($arVelka as $key=>$value) {
$vstup = str_replace($key, $value, $vstup);
}
return $vstup;
}
mb_internal_encoding("UTF-8");
$s = 'áčď';
$novy = diakritika($s); // $novy == ačď
/*******************
* převede kůň na kun
* máte možnosti buď si napíšete funkci sami něci jako diakritikaKlasicka($vstup)
* nebo použijete $word = iconv("utf-8", "us-ascii//TRANSLIT", $word);
*ale výsledek otestujte, ne vždy je u iconv uspokojivý
*/
$word = "kůň";
$word = iconv("utf-8", "us-ascii//TRANSLIT", $word);
function diakritikaKlasicka($vstup) {
$arMala = array('á'=> 'a', 'č'=> 'c', 'ď'=> 'd', 'é'=> 'e', 'ě'=> 'e',
'í'=> 'i', 'ň'=> 'n', 'ó'=> 'o', 'ř'=> 'r', 'š'=> 's', 'ť'=> 't', 'ú'=> 'u',
'ů'=> 'u', 'ý'=> 'y', 'ž'=> 'z' );
$arVelka = array('Á'=> 'A', 'Č'=> 'C', 'Ď'=> 'D', 'É'=> 'E', 'Ě'=> 'E',
'Í'=> 'I', 'Ň'=> 'N', 'Ó'=> 'O', 'Ř'=> 'R', 'Š'=> 'S', 'Ť'=> 'T',
'Ú'=> 'U', 'Ů'=> 'U', 'Ý'=> 'Y', 'Ž'=> 'Z' );
foreach ($arMala as $key=>$value) {
$vstup = str_replace($key, $value, $vstup);
}
foreach ($arVelka as $key=>$value) {
$vstup = str_replace($key, $value, $vstup);
}
return $vstup;
}
Funkce JavaScript pro práci s datumem a časem.
function msToTime(duration) {
var milliseconds = parseInt((duration % 1000) / 100),
seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24);
hours = (hours < 10) ? "0" + hours : hours;
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
return hours + ":" + minutes + ":" + seconds + "." + milliseconds;
}
// console.log(msToTime(300000))
// output: 00:05:00.0
// get time difference between two dates in seconds
var startDate = new Date();
// Do your operations
var endDate = new Date();
var seconds = (endDate.getTime() - startDate.getTime()) / 1000;
var milliseconds = (endDate.getTime() - startDate.getTime());
[, OPTIONAL second param [, OPTIONAL ... param]]
static Date.now() // returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
parse(dateVal) // Date.parse('05 Dec 1998 00:12:00 GMT'); // return 912816720000
toDateString() // sunday 19.7.2020
toTimeString() // 20:15:37
getDate() // 1-31
getDay() // 0-6, 0 == Sunday
var now = new Date();
var dayOfWeekSundayIs7 = now.getDay() == 0)?7:now.getDay();
getFullYear() // 2020
getHours() // 0-23
getMilliseconds() // eg. 956
getMinutes() // 0-59
getMonth() // 0 january
getSeconds() // 0-59
getTime() // https://en.wikipedia.org/wiki/Unix_time
getTimezoneOffset() //returns the time zone difference, in minutes, from current locale
getYear() //does not return full years ("year 2000 problem"), it is no longer used and has been replaced by the getFullYear() method.
setDate(numDate) // 1-31 day of month
setHours(numHours[, numMin[, numSec[, numMilli]]]) // now.setHours(20, 21, 22); 20:21:22
setMilliseconds(numMilli) // 0-999
setMinutes(numMinutes[, numSeconds[, numMilli]]) // 0-59, 0-59, 0-999
setMonth(numMonth[, dateVal]) // 0-11
setSeconds(numSeconds[, numMilli]) 0-59 [, 0-999]
setYear(numYear) // not set full years ("year 2000 problem"), it is no longer used and has been replaced by the setFullYear() method.
setUTCDate() //
setUTCFullYear(2020) // 2020 sets the full year for a specified date according to universal time GMT
setUTCHours()
setUTCMilliseconds()
setUTCMinutes()
setUTCMonth()
setUTCSeconds()
toLocaleTimeString()
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
now.toLocaleDateString(undefined, options); //neděle 19. července 2020
// PDT Pacific Daylight Time (UTC -7)
// GMT ... SET GMT TIME +- ZONE ... new Date('December 31, 1974 23:59:30 GMT-3:00');
toGMTString() // DEPRECATED!!!! use toUTCString()
// Using UTC instead GMT!!!
var d = new Date("2020-07-15T00:00:00.000+07:00"); // UTC + 7
console.log(d.toISOString()); // "2020-07-14T17:00:00.000Z"
console.log(d.valueOf()); // 1594746000000
toISOString() // "2020-07-14T17:00:00.000Z"
toJSON() // "2020-07-14T17:00:00.000Z"
toSource() //This feature is obsolete!!!! Dont use!!!!
toString() // "Tue Jul 14 2020 19:00:00 GMT+0200 (Středoevropský letní čas)"
toUTCString() // "Tue, 14 Jul 2020 17:00:00 GMT"
valueOf() // 1594746000000
Editace: 14.5.2020 - 11:03
Počet článků v kategorii: 77
Url:notepad-select-javascript-content-id-2346