Skip to content

Instantly share code, notes, and snippets.

View jessevondoom's full-sized avatar

Jesse von Doom jessevondoom

View GitHub Profile
@jessevondoom
jessevondoom / gist:1017117
Created June 9, 2011 16:31
Quickly grabs a list of all files from a repo, queues them in an array, then mirrors the repo locally via PHP copy
$repo = json_decode(file_get_contents('https://github.com/api/v2/json/blob/all/cashmusic/DIY/master'));
$files = array_keys((array)$repo->blobs);
foreach ($files as $file) {
$path = pathinfo($file);
if (!is_dir('./source/'.$path['dirname'])) mkdir('./source/'.$path['dirname'],0777,true);
copy('https://raw.github.com/cashmusic/DIY/master/'.$file,'./source/'.$file);
}
@jessevondoom
jessevondoom / gist:1629322
Created January 17, 2012 22:11
Enumerate class/methods/parameters in PHP
<?php
$class_name = 'AdminHelper';
echo $class_name . ' Class:<br />';
$c = new ReflectionClass($class_name);
$methods = $c->getMethods();
echo '<ul>';
foreach ($methods as $method) {
echo '<li>' . $method->getName() . '</li>';
$m = new ReflectionMethod($class_name, $method->getName());
@jessevondoom
jessevondoom / gist:1861080
Created February 18, 2012 21:39
Facebook overlay + styles
<style type="text/css">
.facebox {position:absolute;top:400px;left:50%;margin-left:-260px;margin-right:0;margin-bottom:0;background-color:rgba(82, 82, 82, 0.699219);border-radius:8px;color:#333;font-family:"lucida grande",tahoma,verdana,arial,sans-serif !important;font-size:11px;height:180px;padding:10px;width:500px;z-index:1234;visibility:hidden;}
.facebox_title {position:absolute;top:9px;left:9px;width:480px;height:17px;padding:7px 10px 5px 10px;font-size:14px;font-weight:bold;color:#fff;background-color:#6D84B4;border:1px solid #3B5998;border-bottom-style:none;z-index:500;}
.facebox_content {position:relative;width:500px;height:180px;background-color:#fff;overflow:hidden;outline:1px solid #666;padding:0;}
.facebox_content_details {position:absolute;top:29px;width:460px;height:183px;background-color:#fff;overflow:auto;padding:20px;font-size:11px;}
.facebox_footer {position:absolute;bottom:0;left:0;width:480px;height:27px;padding:10px;background-color:#f2f2f2;border-top:1px solid #ccc;z-index:500;}
.facebox_
@jessevondoom
jessevondoom / cash embed basic .html
Last active December 18, 2015 22:39
Basic CASH Music embed
<script type="text/javascript">
window.cashmusic.embed('http://x.cashmusic.org/public/','2');
</script>
@jessevondoom
jessevondoom / cash embed options .html
Last active December 18, 2015 23:19
CASH Music embed call with all options
<script type="text/javascript">
window.cashmusic.embed(
'http://x.cashmusic.org/public/', // CASH public endpoint
'2', // element id
true, // lightboxed, boolean
'Open this element', // lightbox open link caption
false // target element identifying string (for document.querySelector)
);
</script>
@jessevondoom
jessevondoom / cash script options .html
Last active December 18, 2015 23:19
cashmusic.js JavaScript with options
<script type="text/javascript" src="path/to/cashmusic.js" data-options="lightboxvideo"></script>
@jessevondoom
jessevondoom / inline player .html
Created June 25, 2013 21:08
cashmusic.js inline audio player
<a href="path/to/song.mp3" class="cashmusic soundplayer inline">Song Title</a>
@jessevondoom
jessevondoom / audio toggles .html
Last active December 18, 2015 23:38
cashmusic.js audio toggles
<a href="#" class="cashmusic soundplayer playstop" data-soundid="path/to/song.mp3">Play/stop song</a>
<a href="#" class="cashmusic soundplayer playpause" data-playerid="playerid">Play/pause playlist</a>
@jessevondoom
jessevondoom / audio player via markup .html
Last active December 18, 2015 23:39
cashmusic.js audio player via html/markup
<div class="cashmusic soundplayer playlist" style="display:none;">
<a href="path/to/song1.mp3">Song title 1</a>
<a href="path/to/song2.mp3">Song title 2</a>
</div>
@jessevondoom
jessevondoom / audio player via json .html
Last active December 18, 2015 23:39
cashmusic.js audio player via json
<div class="cashmusic soundplayer playlist"
data-playlist='{
"id":"player1",
"artist":"Artist name",
"album":"Album title",
"tracks":[
{"id":"unique1","title":"Song title 1","url":"path/to/song1.mp3"},
{"id":"unique2","title":"Song title 2","url":"path/to/song2.mp3"}
]
}'