This file contains 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
/* iphone 3 */ | |
@media only screen and (min-device-width: 320px) and (max-device-height: 480px) and (-webkit-device-pixel-ratio: 1) { | |
// whatever | |
} | |
/* iphone 4 */ | |
@media only screen and (min-device-width: 320px) and (max-device-height: 480px) and (-webkit-device-pixel-ratio: 2) { | |
// whatever | |
} |
This file contains 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
geolocateUser() { | |
return new Promise((resolve, reject) => { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(position => { | |
let coordinates = {}; | |
coordinates.lat = position.coords.latitude; | |
coordinates.long = position.coords.longitude |
This file contains 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 name="month" id="month" class="select_month"> | |
<?php | |
for ($i = 1; $i <= 12; $i++){ | |
$monthNumber = ($i < 10) ? '0'.$i : $i; | |
$monthStr = date('F', strtotime("$currentYear-$monthNumber")); | |
echo '<option value="'.$monthNumber.'"'; | |
if ($i == $currentMonth){ | |
echo ' selected="selected"'; | |
} | |
echo '>'.$monthStr.'</option>'; |
This file contains 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 boldText($text){ | |
$regxpattern = '#\|(.*?)\|#'; | |
$html = preg_replace($regxpattern, '<strong>$1</strong>', $text); | |
return $html; | |
} | |
$str = 'lorem ipsum |dolor| sit amet'; | |
echo boldText($str); |
This file contains 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
function boldText(text){ | |
var regxpattern = /\|(\S(.*?\S)?)\|/gm; | |
var html = text.replace(regxpattern, '<strong>$1</strong>'); | |
return html; | |
} | |
document.body.innerHTML = boldText('testing |bold| via regex'); |
This file contains 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
<div id="collapseDVR3" class="panel-collapse collapse in"> | |
<div class="tree "> | |
<ul> | |
<li> <span><i class="fa fa-folder-open"></i> Менюшка</span> | |
<ul> | |
<li> <span><i class="fa fa-minus-square"></i> другая Менюшка</span> | |
<ul> | |
<li> <span> ещё одна Менюшка </span> </li> | |
</ul> |
This file contains 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
// fetch value between # | |
var string = "Chapter #1.0# and \r\n"; | |
var regexChapter = new RegExp(/\#(.*?)\#/g); | |
var regexResult = regexChapter.exec(string) | |
console.log( regexResult ); | |
if( regexResult != null ){ | |
var chapterNumber = regexResult[1]; | |
console.log("Chapter: "+chapterNumber); |
This file contains 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
https://github.com/purifycss/purifycss | |
//used on mobile response project | |
purifycss app/css/merged.css app/js/*.js app/index.html express-server.js --min --info --out app/css/merged-optim.min.css |
This file contains 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
<!DOCTYPE html> | |
<html amp lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<script async src="https://cdn.ampproject.org/v0.js"></script> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<link rel="canonical" href="http://example.ampproject.org/article-metadata.html"> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> |
This file contains 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
<div class="follow-scroll"> | |
Let me follow you. | |
</div> |
NewerOlder