Skip to content

Instantly share code, notes, and snippets.

View mattwiebe's full-sized avatar

Matt Wiebe mattwiebe

View GitHub Profile
<!-- wp:paragraph -->
<p>After my <a href="https://mattwiebe.blog/2023/08/30/how-to-run-codellama-in-vscode-on-macos/">last post</a> about setting up CodeLlama, some colleagues have asked the million dollar question: how does CodeLlama compare to Copilot? My early answer is: "I don't know yet" but here's a useful comparison.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>I have little shell script that lets me interface with <a href="https://phacility.com/phabricator/arcanist/">Arcanist</a> (<code>arc</code>), part of the Phabricator toolset we use internally. One of the (many) weird things about it vs something like Github is that your PRs (Diffs in Phabricator parlance) are independent from git branches. This is a problem when I need to update a Diff, but I don't know what I've been working with from the current branch. <code>git push</code> is just not possible, I need to run <code>arc diff --update DXXXXX</code> instead. But what is the ID?</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>There'
@mattwiebe
mattwiebe / podbean-oembed.php
Created April 21, 2018 16:24
PodBean oEmbed support in WordPress
<?php
/**
* Add Support for PodBean Embed URLs in WordPress.
* Modified from https://core.trac.wordpress.org/ticket/31068#comment:12 to use newer oEmbed endpoint
*
* Just paste an episode URL on a line.
* @link https://core.trac.wordpress.org/ticket/31068#comment:12
* @see wp_oembed_get()
* @param $providers [array] Existing oEmbed Providers
* @return [array] Providers with custom additions
@mattwiebe
mattwiebe / checkPerf.js
Last active March 2, 2016 15:45
Check performance up to a certain point in the page's load, multiple times
/**
* To use: call the function at the point in the load you want to check performance for.
* The page will then reload for @var iterations times to provide multiple measures
*/
function checkPerf() {
var mean;
var iterations = 10;
var times = localStorage.getItem( 'perf' ) ? JSON.parse( localStorage.getItem( 'perf' ) ) : [];
times.push( performance.now() );
localStorage.setItem( 'perf', JSON.stringify( times ) );
curl -s https://typekit.com/api/v1/json/families/gkmg | jsonpretty
{
"family": {
"id": "gkmg",
"name": "Droid Sans",
"slug": "droid-sans",
"web_link": "http://typekit.com/fonts/droid-sans",
"browse_info": {
"capitals": [
"uppercase-lowercase"
@mattwiebe
mattwiebe / keybase.md
Created January 20, 2015 23:54
keybase verification

Keybase proof

I hereby claim:

  • I am mattwiebe on github.
  • I am mattwiebe (https://keybase.io/mattwiebe) on keybase.
  • I have a public key whose fingerprint is 4E08 5645 1F69 5D0A B0FA 2DF0 31C2 3ED8 EDEF 5823

To claim this, I am signing this object:

@mattwiebe
mattwiebe / filter-out.php
Last active December 15, 2015 18:09
Filter out posts according to permissions and categories
<?php
add_action( 'pre_get_posts', 'mw_post_limiter' );
function mw_post_limiter( $wp_query ) {
// only modify for the main query - if we're not there, bail.
if ( ! $wp_query->is_main_query() )
return;
// category_slug => permission
$filtration_pairs = array(
jQuery( document ).ready( function( $ ) {
// Local vars.
var $masthead = $( '#masthead' ),
timeout = false,
$siteInfoClone,
$headerImageClone,
$socialLinksClone,
ajaxRequest = false,
$clickedModule;
@mattwiebe
mattwiebe / exclude-cat.php
Created June 26, 2012 23:40
exclude category from home
<?php
function mw_exclude_cat_from_home( $query ) {
// this is the category ID(s) you want to exclude.
$to_exclude = array( 3 );
if ( $query->is_main_query() && $query->is_home() ) {
$query->set( 'category__not_in', $to_exclude );
}
}
add_action( 'pre_get_posts', 'mw_exclude_cat_from_home' );
@mattwiebe
mattwiebe / disable-twitter-embeds.php
Created June 14, 2012 15:50
Disable Twitter Embeds
<?php
/*
Plugin Name: Disable Twitter Embeds
Description: Disables the Twitter embeds introduced in WordPress 3.4
Version: 1.0
Author: Matt Wiebe
Author URI: http://mattwiebe.wordpress.com/
*/
@mattwiebe
mattwiebe / of-italics.php
Created March 24, 2012 14:54
Options Framework Italics checkbox
<?php
/*
Plugin Name: Options Framework Italics
Plugin URI: http://somadesign.ca/
Description: Add dedicated italics checkbox to the Options Framework typography fields.
Version: 0.1
Author: Soma Design
Author URI: http://somadesign.ca/
License: GPL v2