Skip to content

Instantly share code, notes, and snippets.

View onigetoc's full-sized avatar

Gino onigetoc

View GitHub Profile
@onigetoc
onigetoc / README.md
Created January 25, 2017 03:52 — forked from jlengstorf/README.md
Adds responsive embedding to WordPress oEmbed content.

Responsive Embeds in WordPress

This snippet filters oEmbed output in WordPress (the_content()) to force responsive embeds.

Usage

To use, add the contents of responseive_embeds.less to your site's stylesheet (if you're not using LESS, don't forget to move the iframe,object,embed rule outside of .embed-container and change it to .embed-container iframe,.embed-container object,.embed-container embed).

Then add the responsive_embed() function to your theme's functions.php and insert the add_filter() call in your theme's setup function.

@onigetoc
onigetoc / index.html
Created February 20, 2017 21:58 — forked from anonymous/index.html
Youtube html5 audio Radio player
<div style="display:flex;justify-content:center;align-items:center;">
<div style="width:400px;height:300px;">
<div data-video="uNN6Pj06Cj8" data-autoplay="1" data-loop="1" id="youtube-audio"></div>
<div style="clear:both;margin:10px;text-align:center">
<p>The audio player is created with the YouTube API.</p>
<p>Read Tutorial: <a href="http://www.labnol.org/internet/youtube-audio-player/26740/">YouTube Audio Player</a></p>
</div>
</div>
</div>
@onigetoc
onigetoc / gist:d499d56cdcea9a81eaa693901027d6f2
Created March 20, 2017 18:09
JavaScript: Sorting and filtering data with AngularJS
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularJS Sorting &amp; Filtering Example</title>
<style type="text/css">
body{ font:12px arial, sans-serif; line-height:1.6em; margin:0 auto; max-width:960px; }
// dropzoneWordpressForm is the configuration for the element that has an id attribute
// with the value dropzone-wordpress-form (or dropzoneWordpressForm)
// Install and activate the plugin, and use the `[dropzonejs]` shortcode to display the drop zone.
Dropzone.options.dropzoneWordpressForm = {
//acceptedFiles: "image/*", // all image mime types
acceptedFiles: ".jpg", // only .jpg files
maxFiles: 1,
uploadMultiple: false,
maxFilesize: 5, // 5 MB
//addRemoveLinks: true,
@onigetoc
onigetoc / event.video.youtube.js
Created September 7, 2017 13:05 — forked from benwong/event.video.youtube.js
YouTube iFrame API wrapper for event videos
var EventYouTubeVideo = (function(){
var module = {};
module.init = function(){
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
};
@onigetoc
onigetoc / jsonfeed2rss.php
Created September 11, 2017 02:22 — forked from daveajones/jsonfeed2rss.php
Convert JSONFeed to RSS
<?php
//Convert JSONfeed to RSS in a single function as a drop-in to make adding JSONfeed
//support to an aggregator easier
function convert_jsonfeed_to_rss($content = NULL, $max = NULL)
{
//Test if the content is actual JSON
json_decode($content);
if( json_last_error() !== JSON_ERROR_NONE) return FALSE;
@onigetoc
onigetoc / remove_duplicates_array_multi.js
Created October 17, 2018 12:16 — forked from juliovedovatto/remove_duplicates_array_multi.js
Javascript: Remove duplicates of multidimensional array
// for browser using, this code requires javascript 1.7+
var arr = [
{ foo: 'bar', lorem: 'ipsum' },
{ foo: 'bar', lorem: 'ipsum' },
{ foo: 'bar', lorem: 'ipsum dolor sit amet' }
];
arr = arr.map(JSON.stringify).reverse() // convert to JSON string the array content, then reverse it (to check from end to begining)
.filter(function(item, index, arr){ return arr.indexOf(item, index + 1) === -1; }) // check if there is any occurence of the item in whole array
#EXTINF:0, group-title="Bangladesh",Aakaash
http://mhms9.airtel.tv/wh7f454c46tw4163224253_611767333/PLTV/88888888/224/3221226090/index.m3u8|User-Agent=ExoPlayerDemo/4.4
#EXTINF:0, group-title="Bangladesh",ABP Ananda
http://cshms2.airtel.tv/wh7f454c46taw1033387593_346937752/PLTV/88888888/224/3221226052/1.m3u8|User-Agent=ExoPlayerDemo/4.4
#EXTINF:0, group-title="Bangladesh",Aldwah TV
http://88.202.231.154:1934/c5VydmVyX3RpbEU9Mi8xNy8yMDE0GIDU6RgzQ6NTAgdEoaeFzbF92YWxIZTO0U0ezN1IzMyfvcGVMZEJCTEFWeVN3PTOmdFsaWRtaW51aiPhnPTI/dawah-eu.stream/chunks.m3u8
#EXTINF:0, group-title="Bangladesh",Ananda TV
http://103.252.220.41:1934/c5VydmVyX3RpbEU9Mi8xNy8yMDE0GIDU6RgzQ6NTAgdEoaeFzbF92YWxIZTO0U0ezN1IzMyfvcGVMZEJCTEFWeVN3PTOmdFsaWRtaW51aiPhnPTI/anandatv.stream/playlist.m3u8
#EXTINF:0, group-title="Bangladesh",Asian HD
http://103.252.220.41:1934/c5VydmVyX3RpbEU9Mi8xNy8yMDE0GIDU6RgzQ6NTAgdEoaeFzbF92YWxIZTO0U0ezN1IzMyfvcGVMZEJCTEFWeVN3PTOmdFsaWRtaW51aiPhnPTI/asian-test-sample-ok-d.stream/playlist.m3u8
@onigetoc
onigetoc / m3u-2-JSON.R
Created October 28, 2018 14:48 — forked from christopherlovell/m3u-2-JSON.R
m3u to JSON converter
library(rjson)
trim <- function (x) gsub("^\\s+|\\s+$", "", x)
data_dir = 'Documents/playlists/'
play_list = list()
for(i in list.files(data_dir,"^.*\\.(m3u)$")){
year = substr(i,1,4) # record file specific information, in this case year from playlist group
@onigetoc
onigetoc / itunes-podcast-categories.json
Created November 29, 2018 23:47 — forked from dpellenwood/itunes-podcast-categories.json
A list of the current iTunes podcast categories in different formats
[
{
"Arts": [
"Design",
"Fashion & Beauty",
"Food",
"Literature",
"Performing Arts",
"Visual Arts"
]