Skip to content

Instantly share code, notes, and snippets.

View khripunovpp's full-sized avatar

Pavel khripunovpp

  • Adcombo
  • Porto
View GitHub Profile
1. Install ffmpeg:
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
2. Convert:
ffmpeg -i input-file.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output-file.webm
@khripunovpp
khripunovpp / css
Created August 30, 2019 13:13
glassy effect
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
.modal {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
background-color: rgba(255, 255, 255, 0.5);
}
}
var arabic = /[\u0600-\u06FF]/;
var string = 'عربية‎'; // some Arabic string from Wikipedia
alert(arabic.test(string)); // displays true
1. Open the CF7 contact form which you want to edit in wordpress Admin area. You set up the [checkbox] snippet which produces the checkbox in the contact form on your website:
[checkbox contact_sendmail "Send me a copy of this message"]
2. Activate Mail(2)
3. Add to functions.php
function check_mail_send_contactform($cf7)
{
$submission = WPCF7_Submission::get_instance();
@khripunovpp
khripunovpp / visualy-hidden
Created June 27, 2019 08:47
visualy-hidden
.visualy-hidden {
position: absolute !important;
visibility: hidden !important;
pointer-events: none !important;
clip: rect(0 0 0 0) !important;
clip-path: inset(100%) !important;
width: 1px !important;
height: 1px !important;
margin: -1px !important;
padding: 0 !important;
@khripunovpp
khripunovpp / css
Created May 31, 2019 09:10
autofill-webkit
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
border: 1px solid green;
@khripunovpp
khripunovpp / stop-video.js
Created May 26, 2019 21:56 — forked from johnny77221/stop-video.js
A simple method to stop YouTube, Vimeo, and HTML5 videos from playing.
/**
* Stop an iframe or HTML5 <video> from playing
* @param {Element} element The element that contains the video
*/
var stopVideo = function ( element ) {
element.querySelectorAll('iframe').forEach(function(item) {
if ( iframe.contentWindow ) { /* send stop to content */
stopVideo(iframe.contentWindow.document);
}
else { /* Cross Domain, resetting src is all we can do, and the iframe might fail loading same url */
@khripunovpp
khripunovpp / js
Created April 22, 2019 13:53
animate jq
var a = $('.test');
$({scale: 1}).animate({
scale: 2
}, {
duration: 2000,
step: function(now, fx) {
a.css('transform', 'scale(' + now + ')')
}
}, 'linear');
@khripunovpp
khripunovpp / css
Created April 18, 2019 08:23
remove-tap-highlight
-webkit-tap-highlight-color: transparent;
@khripunovpp
khripunovpp / js
Created March 15, 2019 14:13
parallaxMouse
var parallaxMouse = function(el, coeff, direction) {
$(window).bind('mousemove', function(e) {
parallaxScroll(e);
});
function parallaxScroll(e) {
$(el).each(function() {
var container = $('body'),
containerWidth = container.width(),
containerHeight = container.height(),