Skip to content

Instantly share code, notes, and snippets.

View jmm's full-sized avatar

Jesse McCarthy jmm

View GitHub Profile
@jmm
jmm / README.md
Last active February 9, 2016 21:00
Idea for better format for meaningful discussions on twitter.

Twitter is useful for getting tipped off about stuff that's happening, but frequently that kicks off a discussion, and it's really difficult to have a meaningful discussion on twitter (even when the people involved are capable of it). The messages are too short, especially when they start getting consumed with multiple @ mentions, and it's impossible to follow the course of a discussion with the half-baked way they try to thread them.

I feel like "half-baked" is being generous. Anyone who's ever tried to follow an endless series of "View conversation", "View other replies", and "Show more" links trying to trace the start of the discussion and see all of the comments knows what I'm talking about. It's especially a treat when you have to click "Show more" a bunch of times, then have to click something else to try to see more of the discussion, then try to go back and your place is lost.

I've heard that twitter may ease the limit on message size (maybe drastically, e.g. 10k), but I'm not sure how that would wo

@jmm
jmm / demo.js
Created June 16, 2015 14:31
Demo of issue with creating babel plugin to dynamically insert `import` declaration. See babel/babel#1777
var
babel = require('babel'),
output;
function plugin (babel) {
var t = babel.types;
var transformers = {
Program: {
enter: function (node) {
var newImport = t.importDeclaration(
@jmm
jmm / gist:2066187
Created March 17, 2012 23:02
Workaround for lack of click event support for OPTIONs in OPTGROUPs in jQuery Validation Plugin
$( "#some-form" ).validate( {
'onclick' : function ( element, event ) {
var parent;
if (
( parent = $( element ).filter( "option" ).closest( "select" ) ).length
@jmm
jmm / gist:1817056
Created February 13, 2012 13:44
Experimenting with password length validation within Kohana 3.2 ORM validation system
<?php
class Model_User extends Model_Auth_User {
protected $_raw_data;
public function rules() {
$rules = parent::rules();
@jmm
jmm / gist:1140190
Created August 11, 2011 17:02
Patch for WordPress 3.2.1 wp-includes/canonical.php to redirect /%post_id% to /%post_id%/%postname%
elseif (
is_single() &&
! $redirect_url &&
( $permalink = get_permalink( get_query_var( 'p' ) ) ) &&
(