<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Protip on traviscj/blog</title>
    <link>https://traviscj.com/blog/tags/protip/</link>
    <description>Recent content in Protip on traviscj/blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 27 Mar 2025 10:36:04 -0500</lastBuildDate>
    <atom:link href="https://traviscj.com/blog/tags/protip/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>loan trickery</title>
      <link>https://traviscj.com/blog/post/2025-03-27-loan-trickery/</link>
      <pubDate>Thu, 27 Mar 2025 10:36:04 -0500</pubDate>
      <guid>https://traviscj.com/blog/post/2025-03-27-loan-trickery/</guid>
      <description>&lt;p&gt;I have this &amp;ldquo;American Express Blueprint Business Loan&amp;rdquo; product to have a line of credit for the rentals if I&amp;rsquo;m ever in a pinch.&lt;/p&gt;&#xA;&lt;p&gt;They allow up to $21,700 with this very easy application process, you basically just slide a slider to the amount needed &amp;amp; select between 6, 12, 18, 24 months:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://traviscj.com/blog/assets/amex-slider.png&#34; alt=&#34;amex-slider&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;This shows a schedule like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://traviscj.com/blog/assets/amex-6mo-schedule.png&#34; alt=&#34;amex-6mo-schedule&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Looking at this, there&amp;rsquo;s a lot of temptation to think&lt;/p&gt;</description>
    </item>
    <item>
      <title>hype channels</title>
      <link>https://traviscj.com/blog/post/2021-08-23-hype-channels/</link>
      <pubDate>Mon, 23 Aug 2021 21:20:31 -0500</pubDate>
      <guid>https://traviscj.com/blog/post/2021-08-23-hype-channels/</guid>
      <description>&lt;p&gt;When I was managing a small team, one of the coolest protips I came across was the idea of a &amp;ldquo;hype channel&amp;rdquo;.&#xA;This builds on the idea of a &lt;a href=&#34;https://developer.squareup.com/blog/you-are-your-own-best-hype-person/&#34;&gt;&amp;ldquo;hype doc&amp;rdquo;&lt;/a&gt; by changing the medium: instead of writing into a document, you write blurbs on your own private Slack channel.&lt;/p&gt;&#xA;&lt;p&gt;I’m not sure whether this would help anyone but me, but maybe it’ll help someone else drowning in Chrome tabs?&lt;/p&gt;</description>
    </item>
    <item>
      <title>more light, better pictures</title>
      <link>https://traviscj.com/blog/post/2019-01-05-more_light_better_pictures/</link>
      <pubDate>Sat, 05 Jan 2019 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2019-01-05-more_light_better_pictures/</guid>
      <description>&lt;p&gt;We were trying to take some Christmas pictures but feeling a bit unsatisfied with the way the pictures were coming out:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://traviscj.com/blog/assets/without_lamp_light_s.jpg&#34; alt=&#34;without_lamp_light_s&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I wanted some flash or something, but the batteries on all the &amp;ldquo;better&amp;rdquo; cameras were already dead, so I went looking for an alternative.&#xA;We tried to get the overhead light turned on, but couldn&amp;rsquo;t find the switch for that.&lt;/p&gt;&#xA;&lt;p&gt;The next-closest source of light was a sheet music lamp on my mom&amp;rsquo;s piano!&#xA;Borrowing that for the cause, I was able to get this one instead:&lt;/p&gt;</description>
    </item>
    <item>
      <title>watching progress in mysql</title>
      <link>https://traviscj.com/blog/post/2019-01-04-watching_progress_in_mysql/</link>
      <pubDate>Fri, 04 Jan 2019 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2019-01-04-watching_progress_in_mysql/</guid>
      <description>&lt;p&gt;Pretty frequently at work, I end up &lt;a href=&#34;https://traviscj.com/blog/post/2014-10-15-dont_poll/&#34;&gt;polling&lt;/a&gt; a database with some command like&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;MAX&lt;/span&gt;(id) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; my_tbl;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;MAX&lt;/span&gt;(id) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; my_tbl;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;MAX&lt;/span&gt;(id) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; my_tbl;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;MAX&lt;/span&gt;(id) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; my_tbl;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;-- .... ad nauseam ....&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;ve eventually noticed a few patterns I use pretty consistently:&lt;/p&gt;&#xA;&lt;h3 id=&#34;estimate-eta-by-including-nowunix_timestamp&#34;&gt;estimate ETA by including &lt;code&gt;NOW()&lt;/code&gt;/&lt;code&gt;UNIX_TIMESTAMP()&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Generally, the point of hovering over the table is to get an estimate of when it will finish/catch up/whatever.&#xA;For that, you generally want to include a timestamp in the query output, so when you come back a while later, you can know exactly how much time has elapsed.&#xA;I might transform the above query into&lt;/p&gt;</description>
    </item>
    <item>
      <title>moar stupid jquery tricks</title>
      <link>https://traviscj.com/blog/post/2018-10-23-moar_stupid_jquery_tricks/</link>
      <pubDate>Tue, 23 Oct 2018 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-10-23-moar_stupid_jquery_tricks/</guid>
      <description>&lt;p&gt;Sometimes it&amp;rsquo;s useful to use &lt;a href=&#34;https://tampermonkey.net/&#34;&gt;tampermonkey&lt;/a&gt; on a site without nice &lt;code&gt;id&lt;/code&gt;s for the elements you want to edit.&#xA;It turns out it&amp;rsquo;s still pretty easy!&lt;/p&gt;&#xA;&lt;p&gt;Take &lt;a href=&#34;https://traviscj.com/&#34;&gt;my own website&lt;/a&gt;; I have &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; elements for the headers, but none of them have any &lt;code&gt;id&lt;/code&gt;s associated.&#xA;But as discussed in the &lt;a href=&#34;https://traviscj.com/blog/post/2018-10-17-jquery_selectors/&#34;&gt;jquery selectors&lt;/a&gt; post, we can still select by just the tag, with a selector like&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$(&amp;quot;h2&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This returns a &lt;code&gt;jQuery&lt;/code&gt; object, which behaves like an array.&#xA;If we want to select a particular one &amp;ndash; like &amp;ldquo;Research Interests&amp;rdquo; &amp;ndash; we can try accessing different elements until we get the one we want:&lt;/p&gt;</description>
    </item>
    <item>
      <title>killing all timeouts in js</title>
      <link>https://traviscj.com/blog/post/2018-10-17-killing_all_timeouts_in_js/</link>
      <pubDate>Wed, 17 Oct 2018 20:43:04 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-10-17-killing_all_timeouts_in_js/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://activelab.io/code-snippets/clearing-all-javascript-timeouts&#34;&gt;this article&lt;/a&gt; has a nice trick for killing all javascript timeouts:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;function stopAllTimeouts() {&#xA;    var id = window.setTimeout(null, 0);&#xA;    while (id--) {&#xA;        window.clearTimeout(id);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;which can be entered on the javascript console and then run with&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;stopAllTimeouts()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is an effective way to prevent javascript timeouts from doing a whole variety of things, like&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;carousels&lt;/li&gt;&#xA;&lt;li&gt;endless scrolls&lt;/li&gt;&#xA;&lt;li&gt;any other kind of animations&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>jquery selectors</title>
      <link>https://traviscj.com/blog/post/2018-10-17-jquery_selectors/</link>
      <pubDate>Wed, 17 Oct 2018 03:51:27 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-10-17-jquery_selectors/</guid>
      <description>&lt;p&gt;This is silly, but I always forget this:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;I also learned you can specify things like&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;// @require https://code.jquery.com/jquery-2.1.4.min.js&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;in a Tampermonkey script, even when a given site doesn&amp;rsquo;t already have jquery.&lt;/p&gt;</description>
    </item>
    <item>
      <title>guava RangeMap</title>
      <link>https://traviscj.com/blog/post/2018-01-26-guava-rangemap/</link>
      <pubDate>Fri, 26 Jan 2018 09:52:41 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-01-26-guava-rangemap/</guid>
      <description>&lt;p&gt;We had some code like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;NavigableMap&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;Double, Integer&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; PRIORITY_MULTIPLIERS &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; TreeMap&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;Double, Integer&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;() {{ &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;{{ &amp;#34;&lt;/span&gt; }}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  put(LOW_THRESHOLD, 1);    &lt;span style=&#34;color:#75715e&#34;&gt;// (20k..40k)  =&amp;gt; 1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  put(MEDIUM_THRESHOLD, 2); &lt;span style=&#34;color:#75715e&#34;&gt;// [40k..100k) =&amp;gt; 2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  put(HIGH_THRESHOLD, 3);   &lt;span style=&#34;color:#75715e&#34;&gt;// [100k..+∞)  =&amp;gt; 3&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}};&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Integer &lt;span style=&#34;color:#a6e22e&#34;&gt;getPriorityMultiplier&lt;/span&gt;(Double v) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (v &lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt; LOW_THRESHOLD) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; 0;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; PRIORITY_MULTIPLIERS.&lt;span style=&#34;color:#a6e22e&#34;&gt;floorEntry&lt;/span&gt;(v).&lt;span style=&#34;color:#a6e22e&#34;&gt;getValue&lt;/span&gt;()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I replaced with a [&lt;code&gt;RangeMap&lt;/code&gt;][RangeMap] that uses [&lt;code&gt;Range&lt;/code&gt;][Range] instances as keys:&#xA;[RangeMap]: &lt;a href=&#34;https://google.github.io/guava/releases/16.0/api/docs/com/google/common/collect/RangeMap.html&#34;&gt;https://google.github.io/guava/releases/16.0/api/docs/com/google/common/collect/RangeMap.html&lt;/a&gt;&#xA;[Range]: &lt;a href=&#34;https://google.github.io/guava/releases/16.0/api/docs/com/google/common/collect/Range.html&#34;&gt;https://google.github.io/guava/releases/16.0/api/docs/com/google/common/collect/Range.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;RangeMap&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;Double, Integer&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; PRIORITY_MULTIPLIERS &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; ImmutableRangeMap.&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;Double, Long&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;builder()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      .&lt;span style=&#34;color:#a6e22e&#34;&gt;put&lt;/span&gt;(Range.&lt;span style=&#34;color:#a6e22e&#34;&gt;lessThan&lt;/span&gt;(LOW_THRESHOLD), 0)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      .&lt;span style=&#34;color:#a6e22e&#34;&gt;put&lt;/span&gt;(Range.&lt;span style=&#34;color:#a6e22e&#34;&gt;closedOpen&lt;/span&gt;(LOW_THRESHOLD, MEDIUM_THRESHOLD), 1)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      .&lt;span style=&#34;color:#a6e22e&#34;&gt;put&lt;/span&gt;(Range.&lt;span style=&#34;color:#a6e22e&#34;&gt;closedOpen&lt;/span&gt;(MEDIUM_THRESHOLD, HIGH_THRESHOLD), 2)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      .&lt;span style=&#34;color:#a6e22e&#34;&gt;put&lt;/span&gt;(Range.&lt;span style=&#34;color:#a6e22e&#34;&gt;atLeast&lt;/span&gt;(HIGH_THRESHOLD), 3)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      .&lt;span style=&#34;color:#a6e22e&#34;&gt;build&lt;/span&gt;();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Integer &lt;span style=&#34;color:#a6e22e&#34;&gt;getPriorityMultiplier&lt;/span&gt;(Double v) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; rangePriorityMultipliers.&lt;span style=&#34;color:#a6e22e&#34;&gt;get&lt;/span&gt;(v);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Advantages here being:&lt;/p&gt;</description>
    </item>
    <item>
      <title>everything has a failure rate</title>
      <link>https://traviscj.com/blog/post/2018-01-03-everything-has-a-failure-rate2/</link>
      <pubDate>Wed, 03 Jan 2018 07:09:49 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-01-03-everything-has-a-failure-rate2/</guid>
      <description>&lt;p&gt;I was happily riding in to work this morning on my motorcycle.&#xA;Periodically while riding, a spark of terror that I&amp;rsquo;ve forgotten to buckle my backpack to the bike&amp;rsquo;s frame hits me.&#xA;So frequently, in fact, that I&amp;rsquo;ve grown used to reaching behind me to feel for the backpack in a spare second when I don&amp;rsquo;t need to clutch.&lt;/p&gt;&#xA;&lt;p&gt;Today was different:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;I reached for the backpack but felt nothing.&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>extracting the last few dollars from Visa/MC gift cards</title>
      <link>https://traviscj.com/blog/post/2018-01-02-protip_how_to_extract_the_last_few_dollars_from_visa_mc_gift_cards/</link>
      <pubDate>Tue, 02 Jan 2018 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-01-02-protip_how_to_extract_the_last_few_dollars_from_visa_mc_gift_cards/</guid>
      <description>&lt;p&gt;Once in a while, I get a prepaid gift card like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://usa.visa.com/pay-with-visa/cards/prepaid-cards/_jcr_content/par/cardstack_1559787488/cardStackColumn1/image.img.jpg/1500674305893.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;They&amp;rsquo;re &amp;ndash; like money &amp;ndash; great!&#xA;But they do have one downside: it&amp;rsquo;s hard to spend the change once you&amp;rsquo;ve bought off most of the value.&lt;/p&gt;&#xA;&lt;p&gt;Originally this was going to be a quick &amp;ldquo;just redeem it with Amazon&amp;rsquo;s gift card&amp;rdquo; post, but &lt;a href=&#34;http://www.wisebread.com/how-to-use-up-remaining-balances-on-prepaid-gift-cards&#34;&gt;a bit of study&lt;/a&gt; revealed that it isn&amp;rsquo;t quiet that simple:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the authorized amount can prevent the full transaction from going through, so if it&amp;rsquo;s the first transaction at Amazon, you might need to leave $1.00 to cover the reserve.&lt;/li&gt;&#xA;&lt;li&gt;the article mentions a $5 minimum, but the initial amount &amp;amp; card selection on Amazon doesn&amp;rsquo;t seem to have a problem with lower amounts, so YMMV I guess.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The article also mentions a different solution that I should have thought of: apparently some banks will redeem the value of the card into your account.&#xA;You just need to show up at a branch of your bank with proper identification.&lt;/p&gt;</description>
    </item>
    <item>
      <title>things you don&#39;t learn in grad school</title>
      <link>https://traviscj.com/blog/post/2018-01-01-things_you_dont_learn_in_grad_school/</link>
      <pubDate>Mon, 01 Jan 2018 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-01-01-things_you_dont_learn_in_grad_school/</guid>
      <description>&lt;ol&gt;&#xA;&lt;li&gt;oncall exists.&lt;/li&gt;&#xA;&lt;li&gt;the data is never available how you need it.&lt;/li&gt;&#xA;&lt;li&gt;unit tests matter.&lt;/li&gt;&#xA;&lt;li&gt;pushing code after 3pm is risky if you&amp;rsquo;re not willing to work all night. (courtesy &lt;a href=&#34;https://pauljoos.com&#34;&gt;Paul Joos&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>url encoding safe relational operators</title>
      <link>https://traviscj.com/blog/post/2017-11-29-url-encoding-safe-relational-operators/</link>
      <pubDate>Wed, 29 Nov 2017 07:55:04 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2017-11-29-url-encoding-safe-relational-operators/</guid>
      <description>&lt;p&gt;I was catching up on &lt;a href=&#34;https://publicobject.com/&#34;&gt;Jesse Wilson&amp;rsquo;s blog&lt;/a&gt; this morning, and in particular his post &lt;a href=&#34;https://publicobject.com/2017/08/01/url-encoding-is-material/&#34;&gt;URL Encoding Is Material&lt;/a&gt;.&#xA;In that article, he says&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;My advice&lt;/p&gt;&#xA;&lt;p&gt;If you’re defining your own URLs, you’ll save a lot of trouble by avoiding characters like &amp;lt;, &amp;gt;, {, }, +, ^, &amp;amp;, |, and ;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I came across this problem in one of my projects at work:&#xA;I wanted a page to display some recent records with 1) a &lt;code&gt;name&lt;/code&gt; field provided by the user and 2) a &lt;code&gt;value&lt;/code&gt; field that match $l \leq \text{value} \leq b$, where $l$ and $b$ are given by the user.&#xA;I also wanted that page to have a URL representing that condition, so that it could be easily shared with teammates and soforth.&#xA;When I started working on it, I didn&amp;rsquo;t have Jesse&amp;rsquo;s wisdom, and so I naively came up with a URL structure something like&lt;/p&gt;</description>
    </item>
    <item>
      <title>_useful</title>
      <link>https://traviscj.com/blog/post/2017-04-03-_useful/</link>
      <pubDate>Mon, 03 Apr 2017 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2017-04-03-_useful/</guid>
      <description>&lt;p&gt;I often create a directory/file called &lt;code&gt;_useful&lt;/code&gt;/&lt;code&gt;_useful.org&lt;/code&gt;/&lt;code&gt;_useful.txt&lt;/code&gt;.&#xA;I have one in my Dropbox, for example, that contains:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;My apartment lease&lt;/li&gt;&#xA;&lt;li&gt;My car/motorcycle insurance details&lt;/li&gt;&#xA;&lt;li&gt;A textfile with my vehicle plate numbers/VINs/insurance policy numbers.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;At work, I have one with&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the top visited links for logs/metrics/admin interfaces for the services I work with most&lt;/li&gt;&#xA;&lt;li&gt;a list of links of &amp;ldquo;typical&amp;rdquo; or &amp;ldquo;exemplar&amp;rdquo; things&#xA;&lt;ul&gt;&#xA;&lt;li&gt;links to our internal tool views for typical payments, merchants, etc&lt;/li&gt;&#xA;&lt;li&gt;typical size (in bytes) of various protobuf messages we use a lot, size of 1M messages, #messages in 1MB/GB&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;common coding idioms, like several variants of &lt;code&gt;@RunWith&lt;/code&gt; that we use in various cases in our test code.&lt;/li&gt;&#xA;&lt;li&gt;useful commands for doing stuff (curl/SQL/plain old shell)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Plain text is great for all the reasons it usually is.&#xA;But it&amp;rsquo;s especially useful here (see what I did there?) because the file loads much faster than Google Docs or wiki pages, it&amp;rsquo;s grep-able, it&amp;rsquo;s trivial to copy to a new machine, there&amp;rsquo;s no fuss about futzing with the document to get it to format properly, and soforth.&lt;/p&gt;</description>
    </item>
    <item>
      <title>.sqliterc</title>
      <link>https://traviscj.com/blog/post/2017-03-31-sqliterc/</link>
      <pubDate>Fri, 31 Mar 2017 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2017-03-31-sqliterc/</guid>
      <description>&lt;p&gt;I came across &lt;a href=&#34;https://blog.chmouel.com/2009/07/16/better-output-from-sqlite3-command-line/&#34;&gt;Better output from sqlite3 command line&lt;/a&gt;.&#xA;His &lt;code&gt;.sqliterc&lt;/code&gt; file did not work for me, but the simpler&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;.mode &amp;quot;column&amp;quot;&#xA;.headers on&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;did work nicely.&lt;/p&gt;&#xA;&lt;p&gt;I also found out that &lt;code&gt;brew install sqlite3&lt;/code&gt; does not install the &lt;code&gt;sqlite3&lt;/code&gt; binary to &lt;code&gt;$PATH&lt;/code&gt;, which stinks.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;sqlite3&lt;/code&gt; environment is still much less pleasant than the &lt;code&gt;mysql&lt;/code&gt; cli.&#xA;A few things on my wishlist:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;tab completion of tables, fields, keywords, and functions.&lt;/li&gt;&#xA;&lt;li&gt;nicer &lt;code&gt;.schema&lt;/code&gt; output &amp;ndash; I&amp;rsquo;ve just gotten really used to reading them in mysql output&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It sounds like maybe &lt;a href=&#34;https://github.com/rogerbinns/apsw&#34;&gt;apsw&lt;/a&gt; can be something useful?&#xA;Or maybe Navicat? (but that&amp;rsquo;s expensive)&lt;/p&gt;</description>
    </item>
    <item>
      <title>use the `locale.currency` library function</title>
      <link>https://traviscj.com/blog/post/2017-01-20-use_the_locale.currency_library_function/</link>
      <pubDate>Fri, 20 Jan 2017 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2017-01-20-use_the_locale.currency_library_function/</guid>
      <description>&lt;p&gt;I had stupidly written a pair of functions like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;def comma_sep(amount):&#xA;    thousands = int(amount/1000)&#xA;    remainder = int(amount%1000)&#xA;    if thousands &amp;gt; 0:&#xA;        return comma_sep(thousands)+&amp;quot;,&amp;quot;+&amp;quot;%.3d&amp;quot;%(remainder)&#xA;    else:&#xA;        return str(remainder)&#xA;def friendly_from_cents(total_cents):&#xA;    pos = total_cents &amp;gt;= 0&#xA;    total_cents = abs(total_cents)&#xA;    cents = int(total_cents%100)&#xA;    dollars = int(total_cents/100)&#xA;    friendly = &amp;quot;$&amp;quot;+comma_sep(dollars)+&amp;quot;.&amp;quot;+str(cents)&#xA;    if pos:&#xA;        return friendly&#xA;    else:&#xA;        return &amp;quot;-&amp;quot; + friendly&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is stupid, because python has builtin support to localize currency:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;import locale&#xA;locale.setlocale(locale.LC_ALL, &#39;en_US&#39;)&#xA;locale.currency(-1800, grouping=True)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I think it&amp;rsquo;s tempting to fall into these traps, because it always starts simpler:&#xA;I had some &lt;code&gt;total_cents&lt;/code&gt; variable and just wanted to display quick and dirty.&#xA;The complexity built up gradually, until I had something pretty complicated.&#xA;Oops.&lt;/p&gt;</description>
    </item>
    <item>
      <title>motorcycle learnings at 250 miles</title>
      <link>https://traviscj.com/blog/post/2016-12-02-motorcycle_learnings_at_250_miles/</link>
      <pubDate>Fri, 02 Dec 2016 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2016-12-02-motorcycle_learnings_at_250_miles/</guid>
      <description>&lt;p&gt;Two new learnings at the 250mi point:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The backpack straps down to the back!&lt;/p&gt;&#xA;&lt;p&gt;![]({{ site.baseurl }}/assets/backpack_straps_s.jpg)&lt;/p&gt;&#xA;&lt;p&gt;The balance of the bike feels so much better with the backpack low and riding without weight on my shoulders is so much more comfortable.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Ear Plugs are amazing! I noticed earplugs being worn on &lt;a href=&#34;http://www.longwayround.com/&#34;&gt;The Long Way Round&lt;/a&gt; and decided to try it out. It is really surprising how relevant noises (other cars, etc) make it through fine, but how much nicer it is to not have the wind noise!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Useful homebrew formula</title>
      <link>https://traviscj.com/blog/post/2016-12-01-useful-brew-installs/</link>
      <pubDate>Thu, 01 Dec 2016 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2016-12-01-useful-brew-installs/</guid>
      <description>&lt;p&gt;Last week I was telling &lt;a href=&#34;https://pauljoos.com/&#34;&gt;Paul&lt;/a&gt; about things I have &lt;code&gt;brew install&lt;/code&gt;ed on my work laptop.&#xA;I pulled a &lt;a href=&#34;https://traviscj.com/ZeroBin/?4aad6b057954d42e#8VJqyn80/+WkRlFiwY3KGfQAYxKB+CKs6FhbdyZOP+s=&#34;&gt;full list&lt;/a&gt; as I was doing some upgrades and stuff this morning.&lt;/p&gt;&#xA;&lt;p&gt;Glancing over it a bit, here are some of my favorites/most usefuls:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;autojump&lt;/code&gt; for a usage-adjusting &lt;code&gt;cd&lt;/code&gt; &amp;ndash; given a partial string it just goes to the most-used directory with that prefix. I have &lt;code&gt;autojump&lt;/code&gt; aliased to &lt;code&gt;j&lt;/code&gt; to shorten it up even more.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;colordiff&lt;/code&gt; to make diffs/grep/etc nicer to look at in the terminal.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;coreutils&lt;/code&gt;/&lt;code&gt;dateutils&lt;/code&gt; is nice because it installs the GNU versions of a lot of standard linux commands like &lt;code&gt;du&lt;/code&gt; and &lt;code&gt;ls&lt;/code&gt; and &lt;code&gt;date&lt;/code&gt; that work a bit strange/differently on OSX.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;jq&lt;/code&gt; is amazing — lets you query JSON objects.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ledger&lt;/code&gt; to manage bank balances in plain text.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;newsbeuter&lt;/code&gt; to subscribe to RSS feeds.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;osquery&lt;/code&gt; lets you do SQL-like queries to find out about the system it’s running on (sharvil did a bunch of work on it, actually…)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;terminal-notifier&lt;/code&gt; to pop up notifications from terminal/cron jobs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;tmux&lt;/code&gt; to have long-running terminal windows without having terminal windows open.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;watch&lt;/code&gt; instead of &amp;ldquo;some command&amp;rdquo;+uparrow+enter+uparrow+enter+&amp;hellip;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;wget&lt;/code&gt; as shorthand for “curl http://xyz/tuv.json &amp;gt; tuv.json” (old habits…),&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;youtube-dl&lt;/code&gt; for downloading youtube videos.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>streaks vs statistical streaks</title>
      <link>https://traviscj.com/blog/post/2016-09-26-streaks_vs_statistical_streaks/</link>
      <pubDate>Mon, 26 Sep 2016 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2016-09-26-streaks_vs_statistical_streaks/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://hn.algolia.com/?query=streaks&amp;amp;sort=byPopularity&amp;amp;prefix&amp;amp;page=0&amp;amp;dateRange=all&amp;amp;type=story&#34;&gt;Hacker News et al are obsessed with streaks&lt;/a&gt;, but I think they have some problems:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A single regression resets to zero.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;There&amp;rsquo;s not an easy way to gradually ramp up your streak-commitment over time.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I prefer a different approach: statistical streaks.&lt;/p&gt;&#xA;&lt;p&gt;Suppose I made a commitment to do something differently on 2016-08-26, and did it for the next 5 days; then my 30-day statistical streak avg = 0.166, but my 5-day statistical streak avg = 1.0.&lt;/p&gt;</description>
    </item>
    <item>
      <title>pragmatic edc</title>
      <link>https://traviscj.com/blog/post/2015-12-27-pragmatic_edc/</link>
      <pubDate>Sun, 27 Dec 2015 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2015-12-27-pragmatic_edc/</guid>
      <description>&lt;p&gt;Lots of folks wax poetic about their every day carry kit, and then include things like fishing hooks.&#xA;That might make a &amp;ldquo;pragmatic hiking edc&amp;rdquo; kit, but I&amp;rsquo;m interested in some of the more realistic things that might happen:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Phone is dead and need to call someone (wife, parent, car insurance company, whatever) but don&amp;rsquo;t have the relevant phone number / insurance number / etc.&lt;/li&gt;&#xA;&lt;li&gt;Minor illness like headache, indigestion, things like that.&lt;/li&gt;&#xA;&lt;li&gt;Forgot my wallet at home and need lunch or cab fare.&lt;/li&gt;&#xA;&lt;li&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.amazon.com/Purell-9022-10-Sanitizing-Individually-Wrapped/dp/B000FZ23FA&#34;&gt;purell sanitizing hand wipes&lt;/a&gt;&#xA;&lt;a href=&#34;http://www.amazon.com/Pac-Kit-18-012-Hydrocortisone-Anti-Itch-Packet/dp/B00CEK3D8U&#34;&gt;pac-kit hydrocortisone&lt;/a&gt;&#xA;&lt;a href=&#34;http://www.amazon.com/gp/product/B00E8JRBX8&#34;&gt;pac-kit medication triage pack&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>life pro tip curb rampant consumerism by identifying actual needs</title>
      <link>https://traviscj.com/blog/post/2015-08-23-life_pro_tip_curb_rampant_consumerism_by_identifying_actual_needs/</link>
      <pubDate>Sun, 23 Aug 2015 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2015-08-23-life_pro_tip_curb_rampant_consumerism_by_identifying_actual_needs/</guid>
      <description>&lt;p&gt;A while back, I realized that I wanted a nice digital SLR camera.&#xA;Before I bought it, I made a list of all the things that I wanted to do with it.&#xA;Ultimately, this ended up being a sort of self-justification for buying it, but it did serve one deeper purpose:&#xA;I now had a list of about 20 things that I had committed to doing with my new camera.&#xA;So while it didn&amp;rsquo;t actually prevent me from being rampantly consumerist, I did have a whole set of worthwhile things to do with my new camera!&lt;/p&gt;</description>
    </item>
    <item>
      <title>debugging internet</title>
      <link>https://traviscj.com/blog/post/2014-10-28-debugging_internet/</link>
      <pubDate>Tue, 28 Oct 2014 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2014-10-28-debugging_internet/</guid>
      <description>&lt;p&gt;My standard plan for debugging internet connections:&lt;/p&gt;&#xA;&lt;ol start=&#34;0&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Can we reach stuff from some other device?&lt;/p&gt;&#xA;&lt;p&gt;Usually, connection problems are something like &amp;ldquo;My iPad isn&amp;rsquo;t working,&amp;rdquo; which is caused  by a flash of light in the sky, like when Swamp gas from a weather balloon gets trapped in a thermal pocket and reflects the light from Venus.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;So try something other than your iPad on your WiFi to isolate whether it is a WiFi network problem or a &amp;ldquo;iPad&amp;quot;problem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>don&#39;t poll</title>
      <link>https://traviscj.com/blog/post/2014-10-15-dont_poll/</link>
      <pubDate>Wed, 15 Oct 2014 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2014-10-15-dont_poll/</guid>
      <description>&lt;p&gt;A while ago, I wrote down a list of clever life rules in my day-to-day notebook.&#xA;One of them was &amp;ldquo;don&amp;rsquo;t poll&amp;rdquo;.&#xA;To say a bit more about it, don&amp;rsquo;t spent time waiting for things to finish and checking them constantly.&lt;/p&gt;&#xA;&lt;p&gt;A more concrete example:&#xA;I find myself running terminal commands that take ~5 minutes, and then wasting ~5 minutes watching them.&#xA;This is pretty stupid.&#xA;So what I have started doing instead is run something like&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ some_long_command&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; ... scroll scroll scroll ... &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; ... waiting &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; it to finish ... &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; ... give up ... &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;terminal-notifier -message &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;some_long_command done&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; ... go &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; something &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; ... &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;Then, later I see a notification:&#xA;&lt;img src=&#34;notification_finally_done.png&#34; alt=&#34;notification for finally done&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>14 vs 1499 vs 15</title>
      <link>https://traviscj.com/blog/post/2014-08-22-14_vs_1499_vs_15/</link>
      <pubDate>Fri, 22 Aug 2014 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2014-08-22-14_vs_1499_vs_15/</guid>
      <description>&lt;p&gt;Sometimes, it is tempting to see 14.99 and say &amp;ldquo;about 14,&amp;rdquo; even though we all know better.&#xA;The problem with this is that by giving a 0.07% discount&#xA;(14.99 vs 15),&#xA;they have made you estimate a 7% discount (14 vs 15).&lt;/p&gt;&#xA;&lt;p&gt;Nice trick!&lt;/p&gt;</description>
    </item>
    <item>
      <title>launchd as cron crash course</title>
      <link>https://traviscj.com/blog/post/2014-08-08-launchd_as_cron_crash_course/</link>
      <pubDate>Fri, 08 Aug 2014 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2014-08-08-launchd_as_cron_crash_course/</guid>
      <description>&lt;p&gt;insert&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&#xA;&amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&#xA;&amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&#xA;&amp;lt;dict&amp;gt;&#xA;        &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;&#xA;        &amp;lt;string&amp;gt;com.whatever.five_after&amp;lt;/string&amp;gt;&#xA;        &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;&#xA;        &amp;lt;array&amp;gt;&#xA;                &amp;lt;string&amp;gt;echo just ran &amp;gt; /tmp/whatever_five_after&amp;lt;/string&amp;gt;&#xA;        &amp;lt;/array&amp;gt;&#xA;        &amp;lt;key&amp;gt;StartCalendarInterval&amp;lt;/key&amp;gt;&#xA;        &amp;lt;dict&amp;gt;&#xA;                &amp;lt;key&amp;gt;Minute&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;5&amp;lt;/integer&amp;gt;&#xA;        &amp;lt;/dict&amp;gt;&#xA;&amp;lt;/dict&amp;gt;&#xA;&amp;lt;/plist&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;into &lt;code&gt;$HOME/Library/LaunchAgents/com.whatever.five_after.plist&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you call a script in the ProgramArguments section, remember to make it executable and define the script properly.&lt;/p&gt;&#xA;&lt;p&gt;Run&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;launchctl load $HOME/Library/LaunchAgents/com.whatever.five_after.plist&#xA;launchctl start com.whatever.five_after&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Can also run every N seconds with&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;key&amp;gt;StartInterval&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;N&amp;lt;/integer&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Can also check the status with&lt;/p&gt;</description>
    </item>
    <item>
      <title>some setup notes</title>
      <link>https://traviscj.com/blog/post/2013-10-27-some_setup_notes/</link>
      <pubDate>Sun, 27 Oct 2013 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2013-10-27-some_setup_notes/</guid>
      <description>&lt;h2 id=&#34;zsh&#34;&gt;zsh&lt;/h2&gt;&#xA;&lt;p&gt;Zsh is an amazing (mostly) drop-in replacement for bash.&lt;/p&gt;&#xA;&lt;p&gt;On OSX, just run&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; brew install zsh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You also want to install oh-my-zsh.&lt;/p&gt;&#xA;&lt;p&gt;I went a little crazy with plugins. My list is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;plugins=(autojump brew git git-flow gnu-utils gpg2 osx textmate zsh-syntax-highlighting history-substring-search)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;ssh&#34;&gt;SSH&lt;/h2&gt;&#xA;&lt;p&gt;I ssh a lot. So I have a bunch of host entries in my .ssh/config file. Each looks like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Host [shortname]&#xA;     Hostname [hostname]&#xA;     User     [username for hostname]&#xA;     IdentityFile [my home directory]/.ssh/[id_rsa file for this host]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You also need identity files for hosts you use. I tend to use a different one on each host I connect to; some might consider this overly paranoid. Probably it&amp;rsquo;d be better to use 1 key but only for a shorter period of time. In any case, you need to use&lt;/p&gt;</description>
    </item>
    <item>
      <title>better matlab email notifications</title>
      <link>https://traviscj.com/blog/post/2013-06-25-better_matlab_email_notifications/</link>
      <pubDate>Tue, 25 Jun 2013 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2013-06-25-better_matlab_email_notifications/</guid>
      <description>&lt;p&gt;One of my officemates asked me how I did my MATLAB email notifications. I had&#xA;originally done it &lt;a href=&#34;http://traviscj.com/blog/post/2012-09-28-more_stupid_matlab_tricks/&#34;&gt;here&lt;/a&gt;.&#xA;Of course, the machine we work on most didn&amp;rsquo;t support a mail or msmtp command,&#xA;so I found&#xA;&lt;a href=&#34;http://stackoverflow.com/questions/64505/sending-mail-from-python-using-smtp&#34;&gt;an SMTP script&lt;/a&gt;,&#xA;which worked okay, but frustratingly also required Python. On a bit more sleep,&#xA;it finally occured to me that MATLAB might have an email script.&lt;/p&gt;&#xA;&lt;p&gt;Turns out, &lt;a href=&#34;http://www.mathworks.com/help/matlab/ref/sendmail.html&#34;&gt;it does&lt;/a&gt;.&#xA;I wrote a little wrapper script around this to abstract out some of the email&#xA;details.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Getting really fast at LaTeX</title>
      <link>https://traviscj.com/blog/post/2013-04-10-getting_really_fast_at_latex/</link>
      <pubDate>Wed, 10 Apr 2013 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2013-04-10-getting_really_fast_at_latex/</guid>
      <description>&lt;p&gt;Taking LaTeX notes in real time is one of my favorite useless party tricks. I started developing my techniques during the last year or two of undergraduate work at University of Washington, and was extremely good at it by the end of coursework at Northwestern. There are several keys to taking LaTeX notes in real time:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Know LaTeX.&lt;/li&gt;&#xA;&lt;li&gt;Shortcut appropriately.&lt;/li&gt;&#xA;&lt;li&gt;Type keystrokes quickly.&lt;/li&gt;&#xA;&lt;li&gt;One keystroke re-renders.&lt;/li&gt;&#xA;&lt;li&gt;Type fewer keystrokes.&lt;/li&gt;&#xA;&lt;li&gt;Type fewer “strange” keystrokes (backslashes, curly braces, etc)&lt;/li&gt;&#xA;&lt;li&gt;Re-renders should scroll to your current location in the text.&lt;/li&gt;&#xA;&lt;li&gt;Extremely rapid debugging of LaTeX expressions.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Before I get started, one other note: I mention TextMate a few places, but in principle there is no reason you couldn&amp;rsquo;t configure all the same things in Vim, Emacs, or Sublime Text. If I was starting over, I might use Sublime Text instead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>more stupid matlab tricks</title>
      <link>https://traviscj.com/blog/post/2012-09-28-more_stupid_matlab_tricks/</link>
      <pubDate>Fri, 28 Sep 2012 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2012-09-28-more_stupid_matlab_tricks/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been setting up long-ish runs on my MATLAB instance lately, which is nice because I can wanter off to do something else. The trouble is that I occasionally forget to come back or refocus on work again.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve come up with two solutions to this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The first is to use growlnotify to pop up a persistant growl message. This works well enough as long as I&amp;rsquo;m at the computer:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;system(&amp;#39;growlnotify -s -m &amp;#34;somefile is done&amp;#34;&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&#xA;&lt;li&gt;For more extended aways or if I&amp;rsquo;m going to take a nap while it runs, I might do something more like:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;system(&amp;#39;echo &amp;#34;matlab: uflX_aw_constr_log_5_15 done&amp;#34; | msmtp -a traviscj (mycell)@txt.att.net&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You need some setup before this works: I did a &lt;em&gt;brew install msmtp&lt;/em&gt; and set up a .msmtprc file. After that, it should work goldenly, at least for AT&amp;amp;T customers. Others might need to look up their email/sms gateway number.&lt;/p&gt;</description>
    </item>
    <item>
      <title>debugging matlab mex</title>
      <link>https://traviscj.com/blog/post/2012-08-16-debugging_matlab_mex/</link>
      <pubDate>Thu, 16 Aug 2012 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2012-08-16-debugging_matlab_mex/</guid>
      <description>&lt;p&gt;One thing I&amp;rsquo;ve been doing a bit of lately is debugging MATLAB mex files; it seemed worth documenting.&#xA;The broad strokes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;recompile all mex codes with &amp;lsquo;-g&amp;rsquo;&lt;/li&gt;&#xA;&lt;li&gt;quit MATLAB&lt;/li&gt;&#xA;&lt;li&gt;From a command prompt, run&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ /Applications/MATLAB_R2012a.app/bin/matlab -Dgdb&#xA;[snip]&#xA;(gdb) run -nojvm&#xA;&amp;gt;&amp;gt; run_your_mex_file&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This gives debugging output. If there is an error in the code, you&amp;rsquo;re dropped back to a gdb prompt, where you can continue debugging in a semi-normal fashion.&#xA;Typically, I end up doing a &amp;lsquo;where&amp;rsquo; to get a stack trace, and debug from there more-or-less like usual.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Integrating Sparrow and Aperture/iPhoto</title>
      <link>https://traviscj.com/blog/post/2012-04-13-integrating_sparrow_and_apertureiphoto/</link>
      <pubDate>Fri, 13 Apr 2012 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2012-04-13-integrating_sparrow_and_apertureiphoto/</guid>
      <description>&lt;p&gt;In my recent quest to take on digital photography, I&amp;rsquo;ve been using Apple&amp;rsquo;s Aperture to store download my pictures and do basic manipulation on them. It&amp;rsquo;s been working great, except that emailing is a pain because Apple hardcoded the email clients to:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Apple Mail.app&lt;/li&gt;&#xA;&lt;li&gt;Eudora (really!?)&lt;/li&gt;&#xA;&lt;li&gt;America Online(!?!)&lt;/li&gt;&#xA;&lt;li&gt;Microsoft Entourage&lt;/li&gt;&#xA;&lt;li&gt;Microsoft Outlook&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;while I&amp;rsquo;d prefer to use Sparrow, a lightweight client that Sharvil got me hooked on a while back. Rather than continue to use Mail.app to send pictures via email, I found out that Aperture actually uses some AppleScripts to do the actual sending of the email. That got me thinking: I just need to change the script to mail using Sparrow, instead of Mail.&lt;/p&gt;</description>
    </item>
    <item>
      <title>fibonacci miles and kilometers</title>
      <link>https://traviscj.com/blog/post/2012-03-29-fibonacci_miles_and_kilometers/</link>
      <pubDate>Thu, 29 Mar 2012 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2012-03-29-fibonacci_miles_and_kilometers/</guid>
      <description>&lt;p&gt;In my running, I have been trying to keep track in kilometers. This presents a couple problems: Somehow, my mind still thinks in miles, which is weird because I do not really have /that/ good of an idea exactly how far a mile is, either.&#xA;Or someone wants to know how far a 5k is. Or, when I was running the 2011 Chicago Marathon, there would be kilometer postings between the mile markers. Anyway, it is handy to convert between them, but a bit of a pain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Spaces setup</title>
      <link>https://traviscj.com/blog/post/2010-05-25-spaces_setup/</link>
      <pubDate>Tue, 25 May 2010 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2010-05-25-spaces_setup/</guid>
      <description>&lt;p&gt;My workflow is probably pretty specific, but I figured I’d document it for people looking for ideas on how to set it up. This one seems to work pretty well for me.&lt;/p&gt;&#xA;&lt;p&gt;. Terminal: for running stuff on my and other computers.&#xA;. Textmate: writing mathematics, programming code, etc&#xA;. Mathematica, MATLAB, and Papers&#xA;. Mail and Adium&#xA;. Firefox, Chrome, Safari&#xA;. iTunes and VLC&lt;/p&gt;&#xA;&lt;p&gt;I have this arranged in a 3×2 grid, such that Textmate is top center. From there I can navigate to terminal, math programs, and Firefox directly(control-{left,right,down}). It takes two navigations to get to communication programs and entertainment, which is good for concentration while working.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ZSH and scp/rsync globbing</title>
      <link>https://traviscj.com/blog/post/2010-05-25-zsh_and_scprsync_globbing/</link>
      <pubDate>Tue, 25 May 2010 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2010-05-25-zsh_and_scprsync_globbing/</guid>
      <description>&lt;p&gt;I finally got annoyed at typing&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;tjohnson&amp;gt; scp tcj:*txt .&#xA;zsh: no matches found: tcj:*txt&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I’d always fixed this by the up-CTRL-A-over-over-over-over-quote-CTRL-E-over-over-quote method, ie&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;tjohnson&amp;gt; scp &amp;#34;tcj:*txt&amp;#34; .&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;but the more proper and less annoying version is&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;tjohnson&amp;gt; scp tcj:\*txt .&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However, in the spirit of inspired overkill, there are a couple other options. You can define some new aliases with&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;alias scp=&amp;#39;noglob scp&amp;#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;but that hardly counts as overkill, so instead I edited my .zshrc to include&lt;/p&gt;</description>
    </item>
    <item>
      <title>My Hint for Foreign ATM Machines</title>
      <link>https://traviscj.com/blog/post/2009-02-09-my_hint_for_foreign_atm_machines/</link>
      <pubDate>Mon, 09 Feb 2009 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2009-02-09-my_hint_for_foreign_atm_machines/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been meaning to write this tip up for quite a while, but now that I&amp;rsquo;ve finally gotten some closure on it, I guess now would be a decent time. While I was in Brazil, there were two ATM machine clusters across the street from eachother, both between the beach and the hostel we were staying at. The CITIbank ATMs were more reliable, but the HSBC ATMs were a bit cheaper. At first, it always seemed worth the small extra, but since I never wanted to get much out at a time, I was racking up the bank charges. Also, several people had been using the HSBC ATM without issue, so I figured I would start using that one instead as well. This worked well the first couple of times, but one of the days I went in to get some cash out, it didn&amp;rsquo;t dispense. Undeterred, I went to one of the ATM machines someone else had just (successfully) used and tried there, and withdrew the money. This time it worked.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Minor OS X Shell Shortcomings</title>
      <link>https://traviscj.com/blog/post/2008-10-19-minor_os_x_shell_shortcomings/</link>
      <pubDate>Sun, 19 Oct 2008 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2008-10-19-minor_os_x_shell_shortcomings/</guid>
      <description>&lt;p&gt;In spite of the fact that a lot of people seem to loathe the colorized ls functionality, I sortof grew up on it(so to speak). OS X, by default, does not have this functionality(well, at least, GNU&amp;rsquo;s &amp;ndash;color option never works). I figured the quick and easy way to solve this was to install coreutils, but I found another option. It appears OSX included a version of ls that works with ls -G. The coreutils one is (by it&amp;rsquo;s virtue as a GNU tool) probably more feature-driven, but realiasing it as&lt;/p&gt;</description>
    </item>
    <item>
      <title>Firefox PDF on OSX</title>
      <link>https://traviscj.com/blog/post/2008-06-22-firefox_pdf_on_osx/</link>
      <pubDate>Sun, 22 Jun 2008 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2008-06-22-firefox_pdf_on_osx/</guid>
      <description>&lt;p&gt;June 3 was a fantastic day, though I didn’t know it at the time. The reason? My biggest bitch about Firefox has finally been fixed. The big problem is that Firefox’s OSX program has the default behavior of saving PDFs to Desktop and starting Preview with it. Which isn’t a huge problem, except that if you download the file several times, it just downloads a file with -N appended. This is sortof a pain because in college a lot of teachers call files hw5.pdf, which means that I pretty much have to go to the website each time, or look through about 5 files each time.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
