Skip to content

Instantly share code, notes, and snippets.

@onigetoc
onigetoc / wp-ajax-loadmore.md
Created Oct 5, 2020 — forked from aslamdoctor/wp-ajax-loadmore.md
Wordpress - AJAX Load More Steps
View wp-ajax-loadmore.md

Step 1. Load more button

<?php
global $wp_query; // you can remove this line if everything works for you
 
// don't display the button if there are not enough posts
if (  $wp_query->max_num_pages > 1 )
	echo '<div class="misha_loadmore">More posts</div>'; // you can use <a> as well
?>
@onigetoc
onigetoc / app-code.js
Created Sep 29, 2020 — forked from timhudson/app-code.js
Scroll start/stop events using jQuery
View app-code.js
$(function() {
$(document).on('scrollstart', function() {
console.log('scroll started')
})
$(document).on('scrollend', function() {
console.log('scroll ended')
})
@onigetoc
onigetoc / providers.json
Created Sep 28, 2020 — forked from Niklan/providers.json
Copy of https://oembed.com/providers.json which blocked in Russia. Used for mirroring.
View providers.json
[
{
"provider_name": "23HQ",
"provider_url": "http:\/\/www.23hq.com",
"endpoints": [
{
"schemes": [
"http:\/\/www.23hq.com\/*\/photo\/*"
],
"url": "http:\/\/www.23hq.com\/23\/oembed"
@onigetoc
onigetoc / es7-async-await.js
Created Feb 13, 2020 — forked from msmfsd/es7-async-await.js
Javascript fetch JSON with ES7 Async Await
View es7-async-await.js
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
View oembed_list.json
// https://oembed.com/providers.json
[{
"provider_name": "23HQ",
"provider_url": "http:\/\/www.23hq.com",
"endpoints": [{
"schemes": [
"http:\/\/www.23hq.com\/*\/photo\/*"
],
"url": "http:\/\/www.23hq.com\/23\/oembed"
}]
View oembed_endpoints.js
[{"regex": ["http://*youtube.com/watch*", "http://*.youtube.com/v/*", "https://*youtube.com/watch*", "https://*.youtube.com/v/*", "http://youtu.be/*", "http://*.youtube.com/user/*", "http://*.youtube.com/*#*/*", "http://m.youtube.com/watch*", "http://m.youtube.com/index*", "http://*.youtube.com/profile*", "http://*.youtube.com/view_play_list*", "http://*.youtube.com/playlist*"], "about": "YouTube is the world's most popular online video community, allowing millions of people to discover, watch and share originally-created videos. YouTube provides a forum for people to connect, inform, and inspire others across the globe and acts as a distribution platform for original content creators and advertisers large and small.", "displayname": "YouTube", "name": "youtube", "domain": "youtube.com", "subdomains": ["m.youtube.com"], "favicon": "http://c2548752.cdn.cloudfiles.rackspacecloud.com/youtube.ico", "type": "video"}, {"regex": ["http://*twitch.tv/*", "http://*justin.tv/*/b/*", "http://*justin.tv/*/w/*"], "about":
@onigetoc
onigetoc / index.html
Created Feb 24, 2019
Videojs 7 Player all videos format
View index.html
<div id="instructions">
<!-- <video id="vid1" class="video-js vjs-default-skin vjs-fluid" controls autoplay width="640" height="360"></video> -->
<video id="vid1" class="video-js vjs-default-skin vjs-fluid" poster="http://i.imgur.com/xxqm7EE.png" width="640" height="360" controls autoplay preload="none" data-setup='{ "techOrder": ["html5", "youtube"], "sources": [{ "type": "application/x-mpegURL", "src": "https://nmxlive.akamaized.net/hls/live/529965/Live_1/index.m3u8"}]}'></video>
<!-- <video id="vid1" class="video-js vjs-default-skin vjs-fluid" controls width="640" height="264" data-setup='{ "techOrder": ["youtube"], "sources": [{ "type": "video/youtube", "src": "https://www.youtube.com/watch?v=xjS6SftYQaQ"}] }'>
</video> -->
<h2>Load Video:</h2>
<form id="vsg-loadvideo">
View gist:5efd5f10a17a2c4504a0a8c75f57a76b
javascript:(function(){var%20s=document.createElement('div');s.innerHTML='Loading...';s.style.color='black';s.style.padding='20px';s.style.position='fixed';s.style.zIndex='9999';s.style.fontSize='3.0em';s.style.border='2px%20solid%20black';s.style.right='40px';s.style.top='40px';s.setAttribute('class','selector_gadget_loading');s.style.background='white';document.body.appendChild(s);s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('src','http://www.selectorgadget.com/stable/lib/selectorgadget.js?raw=true');document.body.appendChild(s);})();
You can’t perform that action at this time.