Skip to content

Instantly share code, notes, and snippets.

@mikoim
mikoim / README.md
Last active May 4, 2021
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)
View README.md

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@cklosowski
cklosowski / edd-subsections-example.php
Last active Jan 7, 2016
Using EDD 2.5 Setting Tab Subsections
View edd-subsections-example.php
<?php
/**
* Register our settings section
*
* @return array
*/
function ck_edd_settings_section( $sections ) {
// Note the array key here of 'ck-settings'
$sections['ck-settings'] = __( 'Example EDD Extension', 'example-edd-extension' );
@halgatewood
halgatewood / yt_get_video_url.php
Last active Aug 29, 2015
Get the streaming video (mp4) for your public YouTube videos. -- Download YouTube videos PHP script.
View yt_get_video_url.php
function get_youtube_video_url( $youtube_id )
{
$data = trim(urldecode(file_get_contents('https://youtube.com/get_video_info?video_id=' . $youtube_id)));
$d = parse_str($data, $info);
$stream_map = trim($info['url_encoded_fmt_stream_map']);
if( !$stream_map ) return false;
if( substr( $stream_map, 0, 4 ) != "url=" )
@hadl
hadl / microtime_diff.php
Last active Mar 5, 2021
PHP Microtime Diff -- Calculate a precise time difference
View microtime_diff.php
<?php
/**
* Calculate a precise time difference.
* @param string $start result of microtime()
* @param string $end result of microtime(); if NULL/FALSE/0/'' then it's now
* @return flat difference in seconds, calculated with minimum precision loss
*/
function microtime_diff($start, $end = null)
{
if (!$end) {
@yagitoshiro
yagitoshiro / push_notifications.js
Last active Aug 13, 2016
apple push notification sample (Titanium Mobile)
View push_notifications.js
//////////////////////push_notifications.js///////////////////////
var apns = function(){
var pref = require('preferences').preferences;
Titanium.Network.registerForPushNotifications({
types: [
Titanium.Network.NOTIFICATION_TYPE_BADGE,
Titanium.Network.NOTIFICATION_TYPE_ALERT
],
success:function(e)
@jakebellacera
jakebellacera / ICS.php
Last active May 6, 2021
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
View ICS.php
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*