Skip to content

Instantly share code, notes, and snippets.

@kitze
kitze / LongPress.js
Last active January 8, 2019 07:40
A LongPress component for React
import {React, Component} from 'react';
class LongPress extends Component {
shouldShortPress = true;
componentDidMount() {
this.listenForTouch();
}
componentWillUnmount() {
@cferdinandi
cferdinandi / stop-video.js
Last active February 15, 2024 17:03
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 ) {
var iframe = element.querySelector( 'iframe');
var video = element.querySelector( 'video' );
if ( iframe ) {
var iframeSrc = iframe.src;
iframe.src = iframeSrc;
@tw3eX
tw3eX / update wp
Created January 22, 2014 02:56
update wp
UPDATE wp_options SET option_value = replace(option_value, 'http://wp', 'http://pushkarev-adv.ru') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://wp','http://pushkarev-adv.ru');
UPDATE wp_posts SET post_content = replace(post_content, 'http://wp', 'http://pushkarev-adv.ru');