Shareables

Saturday 1.21.17
Posted by Dexter Adams
No Comments

Embed Hulu Videos on Your Website

<iframe src="https://www.hulu.com/embed.html?eid=771496" width="512" height="288" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen"></iframe>

If you’re using WordPress, first of all, your smart, second of all, you’ll have access to the following handy shortcodes. Easy peezy.


[hulu https://www.hulu.com/watch/771496]
[hulu id=771496]

Video Size:
The default width and height of the embedded video is based off the content width of your theme. To change the size of the video player, for example to 300 pixels wide, use “width” in your shortcode, as follows:

[hulu https://www.hulu.com/watch/771496 width=300]

Thumbnail Image:
Have a particularly funny frame that you want displayed on the player before the video starts playing? Just use thumbnail_frame to specify the specific frame of video you want to display. Again, this is measured in seconds. Here – we’ll choose one with Kevin Smith making a funny face:

[hulu https://www.hulu.com/watch/771496 thumbnail_frame=48]

Playback start and end points:
Only want to play 15 seconds of a 22 minute clip? No problem! Just use start_time and end_time in your shortcode, like this:

[hulu https://www.hulu.com/watch/771496 width=300 start_time=50 end_time=65 thumbnail_frame=48]

Via: https://en.support.wordpress.com/videos/hulu/

Thursday 1.19.17
Posted by Dexter Adams
No Comments

Pixelbay Offers Free High Quality Videos

The other day I stumbled across Pixabay which provides free high quality videos for creatives like you and me. Check them out here.

Friday 4.10.15
Posted by Dexter Adams
No Comments

Create Custom Twitter Widget with Pagination Through Tweets

You’ll first want to create a Twitter App to get your access token, access token secret, consumer key, and consumer secret for authentication later.

You’ll also want to download TwitterAPIExchange.php as you’ll need to ‘require()’ that later.

initialize.php

Create a file named ‘initialize.php’ and put on your server. Include the following functions in it as you’ll need to use them for the feed/widget later.

<?php
require_once( 'initialize.php'); // include the functions you need
require_once( 'TwitterAPIExchange.php'); // include the twitter api
// validate the widget with you credentials
$settings = array(
    'oauth_access_token' => "xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxx",
    'oauth_access_token_secret' => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    'consumer_key' => "xxxxxxxxxxxxxxxxxxxxxx",
    'consumer_secret' => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
);
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$requestMethod = 'GET';
// here we are scrubbing the url for the parameters but if none
// exist we are setting a search, a screen name, and a tweet
// count (per page)
$getfield = $_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : '?q=kubashi&screen_name=kubashi&count=2';
$twitter = new TwitterAPIExchange($settings);
$store = $twitter->setGetfield($getfield)->buildOauth($url, $requestMethod)->performRequest();
$result = json_decode($store);
$multi_array = objectToArray($result);
?>
<ul class="tweets">
    <?php
    // Here's where the magic happens. We will loop through
    // the array given in '$multi_array' and set our tweet layout
    foreach($multi_array['statuses'] as $key => $value ){ ?>
        <?php
        $user = $value['user'];
        $entities = $value['entities'];
        $tweet = links($value["text"]); //converts text links to clickable links
        ?>
        <li class="tweet">
            <div class="text">
                <?php echo $tweet; ?>
            </div>
            <?php if($entities['media']){ ?>
                <?php foreach($entities['media'] as $offset => $entity){ ?>
                    <?php if($entity['media_url'] < 2){ ?>
                        <div class="media lurch">
                        </div>
                    <?php } ?>
                <?php } ?>
            <?php } ?>
            <div class="time"><?php echo twitter_time($value['created_at']); ?></div>
            <div class="action">
                <a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo $value['id_str']; ?>">Reply</a>
                <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo $value['id_str']; ?>">Retweet</a>
            </div>
        </li>
    <?php } ?>
</ul>
<!-- this simple but sexy button allows you to paginate through your tweets -->
<a href="<?php echo $multi_array['search_metadata']['next_results']; ?>">Next</a>

With some cool ajax requests you could do one of those nifty infinite loops. Hopefully this gives you all a base for some really cool implementations. Cheers!

Thursday 3.26.15
Posted by Dexter Adams
No Comments

Set Limits on WordPress Content for Excerpts

<?php
// excerpt
function excerpt($limit) {
    $excerpt = explode(' ', get_the_excerpt(), $limit);
    if (count($excerpt)&gt;=$limit)
    {
        array_pop($excerpt);
        $excerpt = implode(" ",$excerpt).'...';
    }
    else
    {
        $excerpt = implode(" ",$excerpt);
    }
    $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
    return $excerpt;
}
?>
<?php
// content
function content($limit)
{
    $content = explode(' ', get_the_content(), $limit);
    if (count($content)&gt;=$limit)
    {
        array_pop($content);
        $content = implode(" ",$content).'...';
    }
    else
    {
        $content = implode(" ",$content);
    }
    $content = preg_replace('/\[.+\]/','', $content);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]&gt;', ']]&gt;', $content);
    return $content;
}
?>
Thursday 2.5.15
Posted by Dexter Adams
No Comments

Moving Files from One Server to Another *Nix

Open up a new terminal window and use the following commands (you’ll have to be sure the connecting server allows SSH connections before performing the following remote commands):

Remote Server to Local Folder

rsync -avz user@server:target_folder/ destination_folder/

Local Folder to Remote Server

rsync -avz target_folder/ user@server:destination_folder/

Remote Server to Remote Server

rsync -avz user@server:target_folder/ user@server:destination_folder/

Local Folder to Local Folder

rsync -avz target_folder/ destination_folder/

You will then be prompted to use the password to the connecting server. Voila!

Source: http://superuser.com/questions/290634/copy-folders-from-one-unix-server-to-another

Monday 8.20.12
Posted by Dexter Adams
59 Comments
Sunday 4.3.11
Posted by Dexter Adams
26 Comments

Symbol 8 – I Thought You Wanted To Dance

In the song my pops freaks a pretty smooth second verse and adlibs smooth as the Motown sound. FYI, Symbol 8 was featured on American Band Stand in the late 70’s while signed to a label called Janus Records.. Unfortunately the label fizzled and the group was forced to disband. Big ups to Charlie Adams on this one though!

My dad was the lead singer for Symbol 8 and played several instruments, including the flute and sax. When my sister played the track, I could hardly recognize the soulful voice singing on the beginning of the second verse. It sounded like something straight off of a Motown greatest hits album.

It is bittersweet to think that things didn’t turn out big for the group but then again I would have never been here (as in never been born)… and now that wouldn’t be cool would it?


Symbol 8 – I Thought You Wanted To Dance

Update: The music has been remastered as a 12″ rerelease!

Purchase: http://athensofthenorth.bigcartel.com/