Skip to content

Instantly share code, notes, and snippets.

View onigetoc's full-sized avatar

Gino onigetoc

View GitHub Profile
function parseVideo (url) {
// - Supported YouTube URL formats:
// - http://www.youtube.com/watch?v=My2FRPA3Gf8
// - http://youtu.be/My2FRPA3Gf8
// - https://youtube.googleapis.com/v/My2FRPA3Gf8
// - Supported Vimeo URL formats:
// - http://vimeo.com/25451551
// - http://player.vimeo.com/video/25451551
// - Also supports relative URLs:
// - //player.vimeo.com/video/25451551
@Maqsim
Maqsim / hex-to-bgr.js
Created February 13, 2018 23:12
HEX to BGR
'#ff2233'.substr(1).match(/.{2}/g).reverse().join('')
@khryzcf4
khryzcf4 / TV
Created November 27, 2017 00:49
TV
#EXTM3U
#EXTINF:-1 tvg-logo="https://upload.wikimedia.org/wikipedia/commons/6/65/Animaxlogo-20160701.png" group-title="INFANTILES",ANIMAX
http://video7.stream.mx:1935/raxatv/raxatv/chunklist_w884577146.m3u8
#EXTINF:-1 tvg-logo="http://i.imgur.com/exvuGgQ.png" group-title="INFANTILES",ANIME TV
http://video7.stream.mx:1935/raxatv/raxatv/chunklist_w884577146.m3u8?JoCaRoIPTV.m3u8
#EXTINF:-1 tvg-logo="https://vignette.wikia.nocookie.net/logopedia/images/c/ca/Baby_TV.png/revision/latest?cb=20111201223043" group-title="INFANTILES",BABY TV
http://tstv.lcdn.claro.net.co/Content/hls_clear/Live/Channel(BABYTV)/index.m3u8
#EXTINF:-1 tvg-logo="https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Boomerang_tv_logo.png/607px-Boomerang_tv_logo.png" group-title="INFANTILES",BOOMERANG
http://live.izzitv.mx/Content/HLS/Live/Channel(BOOMERANG)/index.m3u8
@daveajones
daveajones / jsonfeed2rss.php
Last active July 8, 2024 17:45
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;
#EXTM3U
#EXTINF:0 type="stream" tvg-logo="http://cdn.idealo.com/folder/Product/61/5/61572/s11_produktbild_mid/sony-icf-c390.jpg" , Radios pelo Mundo
http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
#EXTINF:0 type="stream" tvg-logo="http://cdn.letras.com.br/arquivos/fotos/capas/46/0004553,roberto-carlos-as-baleias.jpg" , Radio Roberto Carlos
http://192.99.150.31:9137/stream
#EXTINF:0 type="stream" tvg-logo="https://static-media.streema.com/media/object-images/8227804f7f5c47d0956ffa91c0ee08ac.png" , Coca -Cola FM
http://s.imusicaradios.com.br:1935/imusica_radio/brasil.stream/playlist.m3u8
#EXTINF:0 type="stream" tvg-logo="https://lh5.ggpht.com/CUcQeArXPT-UOS95gPQOr4OPEvyLnofZ5_SdaM8UJUFnetadqsx2L35mhuDhcR9xglbl=w300" , New Age
http://192.99.150.31:8353/stream
#EXTINF:0 type="stream" tvg-logo="https://www.programamaistorcedor.com.br/uploads/parceiro/logo/17/Mundo_dos_esportes_logo.jpg" , Mundo dos Esportes
@dpellenwood
dpellenwood / itunes-podcast-categories.json
Last active February 21, 2022 11:48 — forked from codeincontext/itunes-podcast-categories.yml
A list of the current iTunes podcast categories in different formats
[
{
"Arts": [
"Design",
"Fashion & Beauty",
"Food",
"Literature",
"Performing Arts",
"Visual Arts"
]
@ajaegers
ajaegers / vanilla.js
Created December 9, 2016 15:16
Javascript Vanilla functions
function hasClass(el, className) {
return el.classList ? el.classList.contains(className) : new RegExp('\\b' + className + '\\b').test(el.className);
}
function addClass(el, className) {
if (el.classList) el.classList.add(className);
else if (!hasClass(el, className)) el.className += ' ' + className;
}
function removeClass(el, className) {
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// 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
@unknownuser88
unknownuser88 / wgetter.js
Created March 14, 2016 18:24
node download file wget
var fs = require('fs');
var url = require('url');
var exec = require('child_process').exec;
var spawn = require('child_process').spawn;
// Function to download file using wget
var download_file_wget = function(file_url, download_dir, file_name_to_save, onProgress, cb) {
// extract the file name
var file_name = url.parse(file_url).pathname.split('/').pop();
@jonobr1
jonobr1 / google-sheet-to-json.js
Last active April 26, 2024 15:41
A node.js script to convert a Google Sheet into a JSON object
/**
* Simple Node.js script to turn a specific page on a Google Sheet
* into a JSON object for the main purpose of HTML Templating.
*
* @author jonobr1 / http://jonobr1.com
*
*/
var https = require('https');
var path = require('path');