Skip to content

Instantly share code, notes, and snippets.

Avatar

Gino onigetoc

View GitHub Profile
@onigetoc
onigetoc / index.html
Created Nov 19, 2022
VimeJS CDN test
View index.html
<div>
<vm-player
theme="dark"
style="--vm-player-theme: #e86c8b;"
>
<vm-video
cross-origin
poster="https://media.vimejs.com/poster.png"
>
<source
@onigetoc
onigetoc / getvideotype.js
Last active Nov 21, 2022
Javascript REGEX - Get video extension from video url and return video Type with IF
View getvideotype.js
/**************************** AUTOMATICALLY GET AND SET AUDIO & VIDEO TYPE ******************************/
const rtmp_suffix = /^rtmp:\/\//;
const hls_suffix = /\.m3u8/;
const mp4_suffix = /\.(mp4|m4p|m4v|mov)/i;
const hds_suffix = /\.f4m/;
const dash_suffix = /\.mpd/;
const flv_suffix = /\.flv/;
const webm_suffix = /\.webm/;
/* AUDIO */
//const mp3_suffix = /\.mp3/;
@onigetoc
onigetoc / getvideotype.js
Last active Nov 22, 2022
javascript Switch Case REGEX - Get video extension from video url and return video Type with CASE
View getvideotype.js
function getType(url) {
switch (true) {
/* AUDIO */
case /\.(mp4|m4p|m4v|mov)/i.test(url):
return 'video/mp4';
break;
/* VIDEO */
case /\.ogg/.test(url):
return 'video/ogg';
@onigetoc
onigetoc / githack.js
Created Oct 13, 2022 — forked from martianyi/githack.js
bookmarklet to view file in raw.githack.com
View githack.js
javascript:(function() {
"use strict";
var TEMPLATES = [
[/^(https?):\/\/gitlab\.com\/([^\/]+\/[^\/]+)\/(?:raw|blob)\/(.+\..+?)(?:\?.*)?$/i, '$1://gl.githack.com/$2/raw/$3'],
[/^(https?):\/\/bitbucket\.org\/([^\/]+\/[^\/]+)\/(?:raw|src)\/(.+\..+?)(?:\?.*)?$/i, '$1://bb.githack.com/$2/raw/$3'],
[/^(https?):\/\/bitbucket\.org\/snippets\/([^\/]+\/[^\/]+)\/revisions\/([^\/\#\?]+)(?:\?[^#]*)?(?:\#file-(.+\..+?))$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/$3/files/$4'],
[/^(https?):\/\/bitbucket\.org\/snippets\/([^\/]+\/[^\/\#\?]+)(?:\?[^#]*)?(?:\#file-(.+\..+?))$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/HEAD/files/$3'],
[/^(https?):\/\/bitbucket\.org\/\!api\/2.0\/snippets\/([^\/]+\/[^\/]+\/[^\/]+)\/files\/(.+\..+?)(?:\?.*)?$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/files/$3'],
[/^(https?):\/\/api\.bitbucket\.org\/2.0\/snippets\/([^\/]+\/[^\/]+\/[^\/]+)\/files\/(.+\..+?)(?:\?.*)?$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/files/$3'],
[/^(
View gist:91b95ef8158c0b88c55522f17c745bb5
{ "categories" :
[ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
@onigetoc
onigetoc / Materialize-Mobile.html
Last active Jul 14, 2022 — forked from TerrenceLP/landing-like-google.html
Materialize CSS Demo Template
View Materialize-Mobile.html
Materialize-Mobile.html
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!--Let browser know website is optimized for mobile-->
@onigetoc
onigetoc / countries.json
Created Jul 12, 2022 — forked from tiagodealmeida/countries.json
List of countries with country code, name, currency code, population, capital and continent name in JSON format
View countries.json
{
"countries": {
"country": [
{
"countryCode": "AD",
"countryName": "Andorra",
"currencyCode": "EUR",
"population": "84000",
"capital": "Andorra la Vella",
"continentName": "Europe"
View hex-to-bgr.js
'#ff2233'.substr(1).match(/.{2}/g).reverse().join('')
@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
?>