<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>Thoughts by Sam.</title>
  <link href="http://soff.es/posts.atom" rel="alternate" title="soff.es" type="application/atom+xml" />
  <link rel="shortcut icon" href="http://a.samsoff.es/assets/favicon-9c4ceaff8a4c0e00a36641baee3ccd90.ico" />
  <link rel="apple-touch-icon-precomposed" href="http://assets.samsoff.es/images/apple-touch-icon.png">
  <link rel="me" href="http://www.google.com/profiles/samsoffes" />
  <link rel="author" type="text/plain" href="http://soff.es/humans.txt" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link href="http://a.samsoff.es/assets/application-37c4de44585a55b8f97c5faea58ae453.css" media="screen" rel="stylesheet" />
  <script src="http://a.samsoff.es/assets/application-d779ccf190045b0509967a07dae46509.js"></script>  <meta property="fb:app_id" content="232071166841950" />
  <meta property="og:site_name" content="soff.es" />
  <link rel="canonical" href="http://soff.es/" />
  <meta property="og:description" content="The blog of Sam Soffes" />
  <meta property="og:title" content="soff.es" />
  <meta property="og:type" content="website" />
  <meta property="og:url" content="http://soff.es/" />
  </head>
<body>
  <header>
  <h1><a href="http://soff.es/">Hi, I&#39;m Sam.</a></h1>
  <p><span class="cheddar">I make this app called <a href="https://cheddarapp.com" rel="external nofollow">Cheddar</a>.</span> Find out <a href="http://soff.es/about">more about me</a>.</p>
  <p>I also like to <a href="http://soff.es/projects">make stuff</a>, <a href="http://soff.es/music">play music</a>, and <a href="http://soff.es/" rel="home">write on technology</a>.</p>
</header>
<section>

  
<section class="blog">
  <article>
  <header>
    <h2><a href="/hello-world">Hello World</a></h2>
    <p>Posted on <time datetime="2013-03-14T10:38:00.000-07:00">March 14, 2013</time></p>
  </header>
  <p>There is a world out there. It&#39;s pretty awesome. Today, I stumbled across this picture:</p>

<p><img src="http://soff.me/Na8I/Screen%20Shot%202013-03-14%20at%201.34.24%20PM.png" alt="2005,2013"></p>

<p>This makes me incredibly sad.</p>

<p>I did something a few months ago that has made me immensely happier day to day. <em>I turned off all of my notifications.</em> No Twitter, email, nothing. I have to manually check all of my apps. This is so great. No more being interrupted at dinner because someone mentioned me in something I don&#39;t care about.</p>

<p>You know how you feel your phone vibrate sometimes, but it was just your leg? That quit happening to me. Crazy, right?</p>

<p>So go outside, be present with the people you love when you&#39;re with them, or go make something. Staring at your little screen isn&#39;t doing anything for you.</p>

</article>
<article>
  <header>
    <h2><a href="/introducing-quesadilla">Introducing Quesadilla</a></h2>
    <p>Posted on <time datetime="2013-03-04T07:28:00.000-08:00">March  4, 2013</time></p>
  </header>
  <p>I&#39;ve been thinking about making this Ruby gem for awhile. It was originally called &quot;cheddar-text&quot;, but I decided something that sounded more fun would be better. Awhile back, I was trying to rewrite this library in C and named the repo Quesadilla. It turns out, writing a C extensions that manipulates strings is really hard, so now the Ruby version is named <a href="https://github.com/soffes/quesadilla">Quesadilla</a>.</p>

<p>Quesadilla is an entity-style text parser. Quesadilla was extracted from <a href="https://cheddarapp.com">Cheddar</a>. It&#39;s what powers all of Cheddar&#39;s text parsing. It was inspired a bit by <a href="https://dev.twitter.com/docs/tweet-entities">Twitter&#39;s tweet entity</a>.</p>

<p>Since Cheddar works on <a href="https://cheddarapp.com/ios">iOS</a> and <a href="https://cheddarapp.com/mac">Mac</a> (as well as the web), I needed something that could give me ranges for special things in the text. iOS and Mac convert this to an <code>NSAttributedString</code> using the indices included in each entity. <a href="https://github.com/nothingmagical/cheddar-ios/blob/master/Classes/CDKTask+CheddariOSAdditions.m#L35">Here&#39;s the source</a> for how <a href="https://cheddarapp.com/ios">Cheddar for iOS</a> does it in Objective-C.</p>

<p>We also use Quesadilla in <a href="https://seesaw.co">Seesaw</a> (my day job). It works really well for us there too.</p>

<p>Quesadilla supports extracting the following:</p>

<ul>
<li>Markdown (italic, bold, bold italic, strikethrough, code, and links)</li>
<li>Links</li>
<li>Named Emoji</li>
<li>Hashtags</li>
<li>User Mentions</li>
</ul>

<p>Here&#39;s a little example of what a hashtag looks like:</p>
<div class="highlight"><pre><span class="no">Quesadilla</span><span class="o">.</span><span class="n">extract</span><span class="p">(</span><span class="s1">&#39;Some #awesome text&#39;</span><span class="p">)</span>
<span class="c1"># =&gt; {</span>
<span class="c1">#   display_text: &quot;Some #awesome text&quot;,</span>
<span class="c1">#   display_html: &quot;Some &lt;a href=\&quot;#hashtag-awesome\&quot; class=\&quot;tag\&quot;&gt;#awesome&lt;/a&gt; text&quot;,</span>
<span class="c1">#   entities: [</span>
<span class="c1">#     {</span>
<span class="c1">#       type: &quot;hashtag&quot;,</span>
<span class="c1">#       text: &quot;#awesome&quot;,</span>
<span class="c1">#       display_text: &quot;#awesome&quot;,</span>
<span class="c1">#       indices: [5, 13],</span>
<span class="c1">#       hashtag: &quot;awesome&quot;,</span>
<span class="c1">#       display_indices: [5, 13]</span>
<span class="c1">#     }</span>
<span class="c1">#   ]</span>
<span class="c1"># }</span>
</pre></div>

<p>You can even provide a custom user validator:</p>
<div class="highlight"><pre><span class="n">validator</span> <span class="o">=</span> <span class="nb">lambda</span> <span class="k">do</span> <span class="o">|</span><span class="n">username</span><span class="o">|</span>
  <span class="c1"># User.where(&#39;LOWER(username) = ?&#39;, username.downcase).first.try(:id)</span>
  <span class="n">username</span> <span class="o">==</span> <span class="s1">&#39;soffes&#39;</span>
<span class="k">end</span>

<span class="n">extraction</span> <span class="o">=</span> <span class="no">Quesadilla</span><span class="o">.</span><span class="n">extract</span><span class="p">(</span><span class="s1">&#39;Real @soffes and fake @nobody&#39;</span><span class="p">,</span> <span class="n">users</span><span class="p">:</span> <span class="kp">true</span><span class="p">,</span> <span class="n">user_validator</span><span class="p">:</span> <span class="n">validator</span><span class="p">)</span>
<span class="c1"># An entity for `soffes` will be added, but not for `nobody`</span>
</pre></div>

<p>Anyway, Quesadilla does a lot of stuff. Checkout the <a href="https://github.com/soffes/quesadilla#readme">readme</a> for more or read the <a href="http://rubydoc.info/github/soffes/quesadilla/master/frames">documentation</a>. It&#39;s tested on Ruby 1.9.2, Ruby 1.9.3, Ruby 2.0.0, JRuby 1.7.2 (1.9 mode), and Rubinius 2.0.0 (1.9 mode), so it should work for you.</p>

<p><a href="https://twitter.com/soffes">Hit my up on Twitter</a> if you find this useful. Enjoy!</p>

</article>
<article>
  <header>
    <h2><a href="/superconf">SuperConf 2013</a></h2>
    <p>Posted on <time datetime="2013-02-22T11:00:00.000-08:00">February 22, 2013</time> in <a class="tag" href="/tags/development">development</a>, <a class="tag" href="/tags/objective-c">objective-c</a>, <a class="tag" href="/tags/ruby">ruby</a>, <a class="tag" href="/tags/soa">soa</a>, and <a class="tag" href="/tags/talks">talks</a></p>
  </header>
  <p>The wonder folks at <a href="http://superconf.co">SuperConf</a> asked me to come to warm Miami and give a talk. I decided to talk about <em>Building Realtime Applications</em>.</p>

<script async class="speakerdeck-embed" data-id="9f6990305edd01307e0412313b031ac2" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"></script>

<p>Here are the links for everything I talked about:</p>

<ul>
<li><a href="https://seesaw.co">Seesaw</a> — where I work</li>
<li><a href="https://cheddarapp.com">Cheddar</a> — a to do app I made</li>
<li><a href="http://en.wikipedia.org/wiki/Service-oriented_architecture">Service-oriented Applications</a> — a great way to build applications</li>
<li><a href="https://github.com/seesawco/totter">Totter</a> — Seesaw API Ruby Gem</li>
<li><a href="http://oauth.net/2">OAuth 2.0</a> — great authentication</li>
<li><a href="http://en.wikipedia.org/wiki/HTML5">HTML5</a> — the future</li>
<li><a href="http://websocket.org">WebSockets</a> — realtime communication between clients and servers</li>
<li><a href="http://pusher.com">Pusher</a> — awesome hosted WebSockets</li>
<li><a href="https://github.com/soffes/bully">Bully</a> — Objective-C Pusher client</li>
<li><a href="http://soff.es/how-to-learn">Go make stuff</a></li>
</ul>

<p>I started a tradition of buying a new <a href="http://typography.com">H&amp;FJ</a> font whenever I give a talk. I bought <a href="http://www.typography.com/fonts/font_overview.php?productLineID=100026&amp;path=head">Whitney</a> first. Then <a href="http://www.typography.com/fonts/font_overview.php?productLineID=100008&amp;path=head">Gotham</a>. I&#39;m finally getting back to buying new fonts after using Gotham for a really long time. Such a great font. Anyway, I bought <a href="http://www.typography.com/fonts/font_overview.php?productLineID=100044&amp;path=head">Landmark</a> and <a href="http://www.typography.com/fonts/font_overview.php?productLineID=100009&amp;path=head">Verlag</a> to use in this talk. I took a ton of inspiration from the Landmark sample images when I was making my slides.</p>

<p>Hopefully you learned something or at least enjoyed seeing me have disproportional amount of fun with my new fonts. You should say hi <a href="https://twitter.com/soffes">on Twitter</a> sometime.</p>

</article>
  <nav class="pagination">
  <span class="disabled">&larr; Previous</span>
  <span class="current">1</span>
  <a href="/2" rel="next">2</a>
  <span class="gap">&hellip;</span>
  <a href="/55">55</a>
  <a href="/56">56</a>
  <a class="next" href="/2" rel="next">Next &rarr;</a>
</nav>
</section>

  </section>
<footer>
  <p>Copyright &copy; 2013 <a href="http://soff.es/" rel="home">Sam Soffes</a> &mdash; <a href="http://soff.es/posts.atom">Feed</a></p>
</footer>

  
  <script type="text/javascript">var _gauges=_gauges||[];(function(){var t=document.createElement('script');t.async=true;t.id='gauges-tracker';t.setAttribute('data-site-id','4f455996cb25bc5d88000087');t.src='//secure.gaug.es/track.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(t, s);})();</script>
</body>
</html>

