Skip to content

Instantly share code, notes, and snippets.

View mikeselander's full-sized avatar
:shipit:
Shipping

Mike Selander mikeselander

:shipit:
Shipping
View GitHub Profile
@mikeselander
mikeselander / how-i-work.md
Last active May 30, 2019 23:43
How I Work

How I Work

When I Work

I typically get in around 9am and leave somewhere around 5:30-6pm Mountain time in the US. This floats ~30 minutes day to day but I tend to stick to a relatively predictable schedule. I will flex my schedule for certain meetings, but prefer to have calls in the evening as opposed to the morning. I'm not a very capable human being until I've had my ☕

I tend to start the morning by reviewing comms and responding to pings that have come in overnight. Once that is all done, I dig into client work and run through to lunch. From there I work another 3-4 hours on client work and might wrap up with some communications or extra reading.

Where I Work

I tend to work from a co-working space of some kind, but that changes by the month. I have a space setup with my big screen, a standing desk, etc. but sometimes other conversations will bleed in as I don't have a dedicated office of my own. If I have a call that's personal for either of us or sensitive, I'll go walk and talk about

This file has been truncated, but you can view the full file.
[20-Mar-2018 20:51:02 UTC] PHP Warning: require_once(/vagrant/content/mu-plugins/advanced-post-cache/advanced-post-cache.php): failed to open stream: No such file or directory in /vagrant/content/mu-plugins/advanced-post-cache.php on line 10
[20-Mar-2018 20:51:02 UTC] PHP Fatal error: require_once(): Failed opening required '/vagrant/content/mu-plugins/advanced-post-cache/advanced-post-cache.php' (include_path='phar:///usr/local/src/wp-cli/bin/wp/vendor/phpunit/php-token-stream:phar:///usr/local/src/wp-cli/bin/wp/vendor/phpunit/phpunit-mock-objects:phar:///usr/local/src/wp-cli/bin/wp/vendor/phpunit/php-code-coverage:phar:///usr/local/src/wp-cli/bin/wp/vendor/phpunit/phpunit:phar:///usr/local/src/wp-cli/bin/wp/vendor/symfony/yaml:.:/usr/share/php') in /vagrant/content/mu-plugins/advanced-post-cache.php on line 10
[20-Mar-2018 20:51:02 UTC] PHP Warning: require_once(/vagrant/content/mu-plugins/advanced-post-cache/advanced-post-cache.php): failed to open stream: No such file or directory in /vagrant/content/m
/**
* Add the Livefyre lf_init_script action to our actions to be modified.
*
* @param array $actions Actions to be modified.
* @return array $actions Actions with our action added.
*/
function modify_livefyre_script_order( $actions ) {
// Move the Livefyre comments output to load after our scripts.
$actions[] = array(
'hook' => 'wp_footer',
private function update_meta_ids( $pid ){
global $wpdb;
$img_id = get_post_meta( $pid, cmb_prefix( get_post_type( $pid ) ) . 'image_id', true);
$img = get_post_meta( $pid, cmb_prefix( get_post_type( $pid ) ) . 'image', true);
if ( empty( $img_id ) && ! empty( $img ) ){
$image = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $img ) );
@mikeselander
mikeselander / clone-all-twitter-github-repos.sh
Created May 10, 2016 07:24 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -u [[USERNAME]] -s https://api.github.com/orgs/[[ORGANIZATION]]/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["clone_url"]} ]}'

Scaffolding 101: A Quick Guide to Building Your Own Frameworks

It pays to know your code. Development, QA time, and bugs all go down when you write and know your own frameworks & libraries.

Building your own repeatable plugin/theme frameworks & libraries can save you money and time and increase code quality. In this talk we’ll cover the basics of why you should build your own reusable codeset, when you should build your own, and how to build a repeatable, quality framework. I’ll take lessons from our own experience building in-house libraries and help you apply them to your business & clients.

$( document ).ready( function (){
if ( window.innerWidth <= 700 && ! $( 'body' ).hasClass( 'front-page' ) ){
$( 'html, body' ).animate({
scrollTop: $( ".my-div" ).offset().top
}, 500 );
}
});
@mikeselander
mikeselander / async_defer.php
Created July 15, 2015 00:56
Asyn & Defer scripts
/**
* Add possibility to asynchroniously load javascript files
*
* Filters all URL strings called in clean_url() for the #asyncload value
* and replaces said string with async='async'
*
* @param string $url The URL for the script resource.
* @returns string Modified script string
*/
add_filter('clean_url', 'add_async_forscript', 11, 1);
@mikeselander
mikeselander / bitbucket-repos.php
Created July 11, 2015 15:45
Create Bitbucket repos en masse
$sites = array(
// Our site array
);
foreach ( $sites as $site ){
$data = array( "name" => $site, "scm" => "git", "is_private" => "true", "fork_policy" => "no_public_forks", "website" => $site );
$data_string = json_encode( $data );
$service_url = 'https://api.bitbucket.org/2.0/repositories/oldtownmedia/'.$data['name'];