Skip to content

Instantly share code, notes, and snippets.

$ ./ffmpeg -i video.mkv -vf subtitles=rus.srt out.mkv
@yuraloginoff
yuraloginoff / firefox-only.css
Last active June 6, 2020 11:18
#css firefox-only
@-moz-document url-prefix() {}
<ul class="tab-nav">
<li><a href="#tab1">tab 1</a></li>
<li><a href="#tab2">tab 2</a></li>
<li><a href="#tab3">tab 3</a></li>
</ul>
<div class="tab-content">
<div class="panel" id="tab1">panel 1</div>
<div class="panel" id="tab2">panel 2</div>
<div class="panel" id="tab3">panel 3</div>
@yuraloginoff
yuraloginoff / formatInputNumber.js
Created November 30, 2015 16:37
Format number in input
// Format number in input
function formatNumber(num) {
return ("" + num).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, function($1) { return $1 + " " });
}
$('.format-num').on('keyup', function () {
$(this).val( formatNumber(this.value.replace(/\s/g, '')) );
});
@yuraloginoff
yuraloginoff / Retina css
Created May 20, 2015 10:04
Retina css styles
@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3 / 1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) {
.logo {
background: url('logo@2x.png') 0 0 no-repeat;
background-size: cover;
}
}
@yuraloginoff
yuraloginoff / html5 audio queue
Last active July 25, 2022 05:55
html5 audio queue
<!doctype html>
<html>
<head>
<script>
//This plays a file, and call a callback once it completed (if a callback is set)
function play(audio, callback) {
audio.play();
if (callback) {
@yuraloginoff
yuraloginoff / css grayscale
Last active June 6, 2020 11:18
#css: grayscale
.grayscale {
-webkit-filter: grayscale(1);
filter: grayscale(1);
}
@yuraloginoff
yuraloginoff / gist:53fac968ae6acea83734
Last active August 29, 2015 14:09
Add social meta tags to your website without plug-ins
<!-- Facebook -->
<meta property="og:title" content="Title of your content" />
<meta property="og:description" content="Description Here" />
<meta property="og:url" content="http://www.example.com" />
<meta property="og:site_name" content="Your Site Name" />
<meta property="og:image" content="http://example.com/ogp.jpg" />
<meta property="og:image:secure_url" content="https://secure.example.com/ogp.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="500" />
<meta property="og:image:height" content="400" />
@yuraloginoff
yuraloginoff / gist:be9906b600973ed3e262
Last active August 29, 2015 14:04
Input placeholder color
input[type=text]::-webkit-input-placeholder { color: #d9d9d9; }/* WebKit browsers */
input[type=text]:-moz-placeholder { color: #d9d9d9; }/* Mozilla Firefox 4 to 18 */
input[type=text]::-moz-placeholder { color: #d9d9d9; }/* Mozilla Firefox 19+ */
input[type=text]:-ms-input-placeholder { color: #d9d9d9; }/* Internet Explorer 10+ */
@yuraloginoff
yuraloginoff / gist:6b169abd595848a71b2e
Last active June 6, 2020 11:24
Responsive layout PHP for loop
<div class="row">
<?php for ($i = 0; $i < count($news); $i++) { ?>
<?php if ($i == 0 ) {
echo '<div class="row">';
} else if ($i != 0 && $i % 4 == 0) {
echo '</div><div class="row">';
} ?>
<?php if ($i == (count($news)-1) && count($news) % 4 != 0) {