Skip to content

Instantly share code, notes, and snippets.

View cdowebcast's full-sized avatar
🏠
Working from home

CDOWEBCAST cdowebcast

🏠
Working from home
View GitHub Profile
@cdowebcast
cdowebcast / index.html
Created January 13, 2019 12:59 — forked from shaan360/index.html
The Spotify logo made with pure CSS
<div class="spotify">
<div class="bar bar-dark"></div>
<div class="bar bar-med"></div>
<div class="bar bar-light"></div>
</div>
@cdowebcast
cdowebcast / curl_progress.php
Created October 28, 2018 04:37 — forked from bdunogier/curl_progress.php
PHP/cURL download progress monitoring
<?php
file_put_contents( 'progress.txt', '' );
$targetFile = fopen( 'testfile.iso', 'w' );
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_NOPROGRESS, false );
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' );
curl_setopt( $ch, CURLOPT_FILE, $targetFile );
@cdowebcast
cdowebcast / meta-tags.md
Created October 5, 2018 14:07 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@cdowebcast
cdowebcast / short-number-format.php
Created January 31, 2018 04:20 — forked from RadGH/short-number-format.php
Short Number Formatter for PHP (1000 to 1k; 1m; 1b; 1t)
<?php
// Converts a number into a short version, eg: 1000 -> 1k
// Based on: http://stackoverflow.com/a/4371114
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {
@cdowebcast
cdowebcast / parseTitleString.js
Created January 27, 2018 18:47 — forked from martindale/parseTitleString.js
Parse a string, such as a YouTube video title, for artist and track information.
// TODO: provide an array of potential separators
// var SEPARATORS = [' - ', ' – ', ' -- ']
// note that these can have spaces, but sometimes do not
// TODO: output a testing dataset for changes to this function.
var TRACK_SEPARATOR = ' - ';
function parseTitleString(string, partsCallback) {
var artist, title, credits = [];
var string = string || '';
;Transcoder configuration file
;Made with the SHOUTcast 2 Configuration Builder
shuffledebug=1
shoutcastdebug=1
uvoxdebug=1
gaindebug=1
playlistdebug=1
mp3encdebug=1
mp3decdebug=1
@cdowebcast
cdowebcast / JSON_Search
Created February 12, 2017 14:26 — forked from idrisjafer/JSON_Search
JSON Seach by Key or Value or Both
@cdowebcast
cdowebcast / AC_RunActiveContent.js
Created November 27, 2016 23:51
Flash Player Version Detection v1.7
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved.
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
@cdowebcast
cdowebcast / .htaccess
Created November 17, 2016 23:46 — forked from fael/.htaccess
Exemplo PHPMailer + Tratamento de erros via HTACCESS + Qualquer console JS
# PHP error handling for production servers
# disable display of startup errors
php_flag display_startup_errors off
# disable display of all other errors
php_flag display_errors off
# disable html markup of errors
php_flag html_errors off
@cdowebcast
cdowebcast / youtube_iframe.py
Created May 19, 2016 17:59 — forked from ryonsherman/youtube_iframe.py
Parse Youtube URL, extract video ID, and provide embed iframe.
from urlparse import urlparse, parse_qs
url = urlparse('https://www.youtube.com/watch?v=XXXXXXXXXXX')
if 'youtube' in url.netloc.lower():
video_id = parse_qs(url.query).get('v', [False])[0]
if video_id:
print '<iframe width="560" height="315" src="http://www.youtube.com/embed/{0}" frameborder="0" allowfullscreen></iframe>'.format(video_id)