Skip to content

Instantly share code, notes, and snippets.

View cdevroe's full-sized avatar
:octocat:
Probably writing.

Colin Devroe cdevroe

:octocat:
Probably writing.
View GitHub Profile
@cdevroe
cdevroe / move_files.php
Last active April 13, 2020 17:33
Look at files in a directory, move them into new directories based on Date Created
<?php
/*
Created by Colin Devroe
cdevroe.com
*/
// Help
if ( isset($argv[1]) && ($argv[1] == '-h' || $argv[1] == '-help') ) :
print 'Colin\'s Photo Backup Utility' . "\n";
@cdevroe
cdevroe / readme.md
Last active March 6, 2025 12:32
YouTube pop-up Bookmarklet

YouTube Pop-up Bookmarklet

I forget where I found this originally (sorry). And I've modified it slightly over the years. But if you're on YouTube in a desktop browser and you'd like to have the video in a small pop-up window, tap this bookmarklet and it automatically creates the perfectly sized window for you.

How to install

  1. Create a new bookmark with any URL.
  2. Edit that bookmark in your browser, delete the URL that is there, and paste the code you see in the JS file into the Location field.

You're welcome / Colin

@cdevroe
cdevroe / microblog-userstyle.css
Created May 21, 2018 17:29
Micro.blog Userstyle
/* Add bottom border and some spacing to each post. */
.post {
border-bottom: 1px solid rgb(230, 236, 240);
margin-bottom: 20px;
}
/* Move avatar to left */
.post .post_avatar {
float: left;
width: 18%;
}
@cdevroe
cdevroe / nepa-gulp.js
Created July 14, 2017 15:10
NEPA.js Gulp Demo
/*
Task: NepaJS
Does some silly things for NEPA JS
*/
gulp.task('nepajs', function() {
var nepajsURL = 'https://www.meetup.com/NEPA-js/',
nepaJSDirWin = '/mnt/c/Users/tucker/Desktop/',
nepaJSDirMac = '/Users/cdevroe/Desktop/',
@cdevroe
cdevroe / tweet-status.php
Created January 25, 2017 19:35
Publish posts, statuses, images, to Twitter from WordPress
<?php
/**
* Plugin Name: Tweet Statuses
* Description: A simple plugin that will tweet a status when published.
* Author: Colin Devroe
* Author URI: http://cdevroe.com/
* Version: 0.1.0
*
* TwitterAPIExchange is here: http://github.com/j7mbo/twitter-api-php
*/
@cdevroe
cdevroe / convert_roman.js
Created January 9, 2017 13:52
INCOMPLETE: Convert number into Roman numeral in JavaScript
(function (win,doc) {
'use strict';
var submit = document.getElementById('submit');
submit.addEventListener( 'click', function(){
var number = document.getElementById('number'),
roman_numeral = document.getElementById('roman');
roman_numeral.innerHTML = convert_to_roman(number.value);
@cdevroe
cdevroe / wp-is_published-is_draft.php
Created January 6, 2016 16:03
WordPress is_published is_draft functions
<?php
/**
* Determine whether a post or page is published or not.
*
* @return bool
*/
function is_published(){
$post = get_post();
if ( $post->post_status == 'publish' ) return true;
@cdevroe
cdevroe / Template_Client-Call.txt
Created November 19, 2015 17:56
Client Call Text Document Template
Template: Client Call % Client Name % - % Date %
# Call information
Dial-in information:
- Number:
- Pin:
- URL:
Parties on call:
@cdevroe
cdevroe / hypertext-member-blogs.opml
Last active December 10, 2015 23:59
Hypertext Member Blogs
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Hypertext Member Blogs</title>
</head>
<body>
<outline text="Hypertext Member Blogs" title="Hypertext Member Blogs">
<outline type="rss" text="Colin Devroe" title="Colin Devroe" xmlUrl="http://cdevroe.com/feed" htmlUrl="http://cdevroe.com/"/>
<outline type="rss" text="Hypertext" title="Hypertext by Justin Blanton" xmlUrl="http://feeds.feedburner.com/jblanton" htmlUrl="http://hypertext.net"/>
@cdevroe
cdevroe / gist:4fb3ebf7806b39020c33
Created May 28, 2015 14:17
Open Visual Studio Code from Terminal
code () {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code" -n
else
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
open -a "Visual Studio Code" -n --args "$F"
fi
}