<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
 <channel>
  <atom:link href="https://schoberg.net/feed?limit=10" rel="self"/>
  <title/>
  <link>https://schoberg.net/#blog</link>
  <description/>
  <item>
   <guid>https://schoberg.net/hotdog</guid>
   <title>&quot;What’s the Hot Dog?&quot; How to Outsmart Your Inner Lawyer</title>
   <link>https://schoberg.net/hotdog</link>
   <description>I've noticed that when it comes to making decisions, we often tell ourselves a story, one full of reasons that sound good but don't really get to</description>
   <content:encoded><![CDATA[<img src="https://dropinblog.net/34252905/files/featured/whats-the-hot-dog.png" /><p>I&#39;ve noticed that when it comes to making decisions, we often tell ourselves a story, one full of reasons that sound good but don&#39;t really get to the point. We rationalize why we want to move, switch jobs, or start something new, layering on justifications that distract from the real reason.&nbsp;</p><p>What if we could cut through all that noise and get to the real reason? In Rework, there&#39;s a great analogy about a hot dog stand: focus on the <strong>hot dog</strong> (the core of your business) and forget the distractions. At the same time, The Happiness Hypothesis talks about our &quot;<strong>inner lawyer</strong>,&quot; the part of us that backs up our gut feelings with a lot of random arguments.</p><p><strong>In this post, I&#39;ll show how combining these ideas can help us simplify decision-making.</strong> It starts with one simple question: <strong>What&#39;s the hot dog?</strong><em>&nbsp;</em>What&#39;s the one true reason driving this decision?</p><h2 id="the-hot-dog-from-rework-focusing-on-the-core-1">The &quot;Hot Dog&quot; from Rework: Focusing on the Core</h2><p>In Rework, there&#39;s a story about a hot dog stand that really resonated with me. The idea is simple: if you&#39;re running a hot dog stand, what really matters? The hot dogs. You don&#39;t need a complicated menu, relish, or even buns. At its core, you really only need hot dogs. The rest is just <em>extras</em>.</p><div class="fr-img-space-wrap"><span class="fr-img-caption fr-fic fr-dib" style="width: 700px;"><span class="fr-img-wrap"><img src="https://dropinblog.net/34252905/files/hot-dog-rework.png" class="fr-fic fr-dib" width="700" height="260" alt="For example, if you're opening a hot dog stand, you could worry about the condiments, the cart, the name, the decoration. But the first thing you should worry about is the hot dog. The hot dogs are the epicenter. Everything else is secondary. The way to find the epicenter is to ask yourself this question: 'If I took this away, would what I'm selling still exist?' A hot dog stand isn't a hot dog stand without the hot dogs. You can take away the onions, the relish, the mustard, etc. Some people may not like your toppings-less dogs, but you'd still have a hot dog stand. But you simply cannot have a hot dog stand without any hot dogs."><span class="fr-inner">Page from &#39;Rework&#39; by Jason Fried and David Heinemeier Hansson of 37signals</span></span></span></div><p>I think this applies to more than just business. Whether we&#39;re making personal or professional decisions, it&#39;s easy to get distracted by all the extra details. We convince ourselves that those details are important, but they&#39;re really not. The key is to focus on what actually matters what&#39;s at the core of the decision.</p><h2 id="the-inner-lawyer-from-the-happiness-hypothesis-how-we-rationalize-2">The &quot;Inner Lawyer&quot; from The Happiness Hypothesis: How We Rationalize</h2><p>In The Happiness Hypothesis, Jonathan Haidt introduces the idea of the &quot;inner lawyer.&quot; Basically, our minds are wired to defend our gut feelings, even when those feelings aren&#39;t based on logic.</p><p>Our &quot;inner lawyer&quot; subconsciously comes up with reasons (generally after the fact) that justify what we already feel. It&#39;s like we&#39;re building a case for ourselves, making sure everything lines up to support the decision we&#39;ve already made. The inner lawyer doesn&#39;t just justify decisions we&#39;ve already made; it can just as easily construct arguments for the opposite stance, depending on what we want to believe.</p><div class="fr-img-space-wrap"><span class="fr-img-caption fr-fic fr-dib" style="width: 700px;"><span class="fr-img-wrap"><img src="https://dropinblog.net/34252905/files/inner-lawyer-happiness-hypothisis.png" class="fr-fic fr-dib" width="700" height="768" alt="One of the reasons people are often contemptuous of lawyers is that they fight for a client's interests, not for the truth. To be a good lawyer, it often helps to be a good liar. Although many lawyers won't tell a direct lie, most will do what they can to hide inconvenient facts while weaving a plausible alternative story for the judge and jury, a story that they sometimes know is not true. Our inner lawyer works in the same way, but, somehow, we actually believe the stories he makes up.  When people are given difficult questions to think about—for example, whether the minimum wage should be raised—they generally lean one way or the other right away, and then put a call in to reasoning to see whether support for that position is forthcoming. For example, a person whose first instinct is that the minimum wage should be raised looks around for supporting evidence. If she thinks of her Aunt Flo who is working for the minimum wage and can't support her family on it then yes, that means the minimum wage should be raised. All done. Deanna Kuhn, a cognitive psychologist who has studied such everyday reasoning, found that most people readily offered 'pseudoevidence' like the anecdote about Aunt Flo. Most people gave no real evidence for their positions, and most made no effort to look for evidence opposing their initial positions. David Perkins, a Harvard psychologist who has devoted his career to improving reasoning, found the same thing. He says that thinking generally uses the 'makes-sense' stopping rule. We take a position, look for evidence that supports it, and if we find some evidence enough so that our position 'makes sense'—we stop thinking."><span class="fr-inner">Page from &#39;The Happiness Hypothesis&#39; by Jonathan Haidt</span></span></span></div><p>The problem is, those reasons can be flimsy. We might tell ourselves we&#39;re moving for the weather or because of better job prospects, but are those the real reasons? Probably not. The inner lawyer just pulls together whatever arguments will make the choice feel more legitimate, even if they&#39;re not the core truth.</p><h2 id="merging-the-concepts-what-s-the-hot-dog-3">Merging the Concepts: &quot;What&#39;s the Hot Dog?&quot;</h2><p>So how do these two ideas, Rework&#39;s &quot;hot dog&quot; and Haidt&#39;s &quot;inner lawyer,&quot; come together? For me, it&#39;s about asking one question: What&#39;s the hot dog? What&#39;s the real, underlying reason behind this decision, belief, or desire?</p><p>When you strip away the justifications your inner lawyer is throwing at you, the goal is to find that one core driver, or the &quot;hot dog&quot;.</p><p>Maybe you&#39;re thinking about moving to a new city. You start by listing all the reasons: better job opportunities, nicer weather, friends who live nearby. But when you really ask yourself, What&#39;s the hot dog? you might find that the real reason is something simpler, like just wanting a change.</p><p>This question cuts through all the noise. It&#39;s a way to get past rationalizations and focus on the one true reason driving your choice.</p><h2 id="examples-4">Examples</h2><p>Let&#39;s look at how this plays out in real life.</p><ol><li><strong>A friend invites you to dinner, but you don&#39;t want to go.</strong> You start thinking of excuses: you&#39;re too tired, you&#39;ve got work tomorrow, maybe you don&#39;t like the restaurant. But what&#39;s the hot dog here? Maybe <em>you&#39;re not feeling up for socializing today.</em></li><li><strong>You feel the need to own your own home.</strong> You might rattle off reasons like building equity, having a stable investment, or avoiding rent hikes. But what&#39;s the hot dog? Maybe it&#39;s <em>having a space that feels like it&#39;s truly yours.</em></li><li><strong>You&#39;re in an unhealthy relationship, but choose to stay.</strong> You tell yourself things like &quot;It&#39;ll get better&quot; or &quot;I won&#39;t find anyone better.&quot; But when you really ask, what&#39;s the hot dog? Maybe it&#39;s that <em>you&#39;re afraid of being alone</em>.</li></ol><p><img src="https://dropinblog.net/34252905/files/rent-or-buy.png" class="fr-fic fr-dib" width="700" height="409"></p><h2 id="using-what-s-the-hot-dog-to-clarify-choices-5">Using &quot;What&#39;s the Hot Dog?&quot; to Clarify Choices</h2><p>Let&#39;s dig deeper into the second example: whether to own your primary home. Once you&#39;ve stripped away your inner lawyer&#39;s justifications, like building equity or avoiding rent hikes and identified that your hot dog is simply having a space that feels like yours, now you can focus on just that.</p><p>Now you can ask yourself: how do I achieve that feeling of a home that&#39;s truly mine? Your gut might tell you that owning is the only way to buy furniture, artwork, and choose paint colors. But you don&#39;t necessarily need to own a home to do that. With a longer-term lease, you could still create that same sense of ownership, decorating and settling into a place that feels like yours without the commitment of ownership.</p><p>This clarity also allows you to objectively consider the other advantages of renting. Maybe renting gives you the flexibility to move quickly if your job changes or your partner&#39;s career takes a different turn. Or you might find that avoiding the risk of having a construction project pop up next door is worth more to you than the potential of turning your home into a real estate investment. Now, instead of making the decision based on your inner lawyer&#39;s justifications, you&#39;re weighing your options against the one real reason: your hot dog.</p><h2 id="conclusion-6">Conclusion</h2><p>Decisions can easily get lost in a mess of our inner lawyer&#39;s justifications. But asking <em>&quot;What&#39;s the hot dog?&quot;</em> cuts through all that, helping you find the core reason behind a choice, emotion, or belief.</p>]]></content:encoded>
   <media:content url="https://dropinblog.net/34252905/files/featured/whats-the-hot-dog.png" medium="image"/>
   <media:thumbnail url="https://dropinblog.net/cdn-cgi/image/fit=scale-down,width=1200/34252905/files/featured/whats-the-hot-dog.png" medium="image" width="1200"/>
   <media:thumbnail url="https://dropinblog.net/cdn-cgi/image/fit=scale-down,width=700/34252905/files/featured/whats-the-hot-dog.png" medium="image" width="700"/>
   <media:thumbnail url="https://dropinblog.net/cdn-cgi/image/fit=scale-down,width=480/34252905/files/featured/whats-the-hot-dog.png" medium="image" width="480"/>
   <category>Thoughts</category>
   <pubDate>Fri, 06 Sep 2024 05:19:00 -0500</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/myamount</guid>
   <title>My Amount: Embracing Compassion Over Judgment</title>
   <link>https://schoberg.net/myamount</link>
   <description>Have you ever noticed how we all silently think, &quot;My amount is okay&quot; about our life choices? It's a common thought process that really shows up when</description>
   <content:encoded><![CDATA[<img src="https://dropinblog.net/34252905/files/featured/my-amount-jesse-schoberg.png" /><p>Have you ever noticed how we all silently think, &quot;My amount is okay&quot; about our life choices? It&#39;s a common thought process that really shows up when we see others making different choices. Whether it&#39;s about how much we spend, our lifestyle choices, or even our habits, we all have our own &#39;amounts&#39; that feel right. This idea is what led me to come up with the &quot;My Amount&quot; concept a few years back.</p><p><strong>&quot;My Amount&quot; is one&#39;s personal acceptable limit on a consumption, purchase or other decision.</strong></p><h2>&#39;My Amount&#39; Examples</h2><p>Example: one person might easily spend $100 on high-quality jeans but choose to be frugal when it comes to eating out. Another might never spend over $40 on jeans &#39;cause &#39;why would you?&#39;, yet loves to drop $100 on a nice dinner out.</p><p><img src="https://app.dropinblog.com/uploaded/blogs/34252905/files/my-amount.png" alt="My Amount" width="700" height="402" class="fr-dib"></p><p>But it&#39;s not all about money, it can be about anything. Take drinking habits: for some, four drinks is their max for a big night out, citing their health, while others might set their limit to ten (or infinity) &#39;cause &#39;I like to enjoy myself&#39;. Each &#39;amount&#39; reflects what we consider okay for ourselves, influenced by our health views, lifestyle, and personal choices. I propose we try to appreciate these differences as what makes us unique, in an effort to reduce judgement and seek empathy.</p><h2>Where do our &#39;Amounts&#39; Come From?</h2><p>So, why do we all have different &#39;amounts&#39;? From my observations, it has a million factors. Our upbringing, culture, relationship with money, genetics, and life experiences shape our views. What&#39;s a splurge for you might be a no-brainer for someone else. It&#39;s all about perspective.</p><h2>My Amount is Okay (and so is yours)</h2><p>We&#39;ve all been there, judging someone else&#39;s &#39;amount&#39;. But maybe we can flip the script and get curious instead. Understanding why someone has a different &#39;amount&#39; can open our eyes. It&#39;s about stepping into their shoes and seeing things from their angle.</p><p>&#39;My Amount&#39; is a lens through which we all view the world. By recognizing and respecting the different &#39;amounts&#39; people have, we&#39;re taking a step towards being more understanding and less judgmental. Next time you bump into a different &#39;amount&#39;, why not ask about the story behind it?</p>]]></content:encoded>
   <media:content url="https://dropinblog.net/34252905/files/featured/my-amount-jesse-schoberg.png" medium="image"/>
   <media:thumbnail url="https://dropinblog.net/cdn-cgi/image/fit=scale-down,width=1200/34252905/files/featured/my-amount-jesse-schoberg.png" medium="image" width="1200"/>
   <media:thumbnail url="https://dropinblog.net/cdn-cgi/image/fit=scale-down,width=700/34252905/files/featured/my-amount-jesse-schoberg.png" medium="image" width="700"/>
   <media:thumbnail url="https://dropinblog.net/cdn-cgi/image/fit=scale-down,width=480/34252905/files/featured/my-amount-jesse-schoberg.png" medium="image" width="480"/>
   <category>Thoughts</category>
   <pubDate>Sat, 18 Nov 2023 03:25:00 -0600</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/free-qr-code-generator</guid>
   <title>Free QR Code Generator</title>
   <link>https://schoberg.net/free-qr-code-generator</link>
   <description>This has been moved to it's own domain 👉 GratisQR. com QR Code contents: (Right Click &gt; Save Image As...) I wrote this simple script (that uses the</description>
   <content:encoded><![CDATA[<p>This has been moved to it's own domain 👉 <a href="https://gratisqr.com">GratisQR.com</a></p>
<p><a href="https://gratisqr.com"><img class="" src="https://app.dropinblog.com/uploaded/blogs/34252905/files/free-qr-code-maker.png" alt="" width="1011" height="1024" /></a></p>
<p><label for="qr">QR Code contents:</label><br /><input id="qr" style="width: 100%; padding: 10px; border-radius: 5px; border: 2px solid #ccc; box-sizing: border-box;" type="text" placeholder="https://gratisqr.com" width="500" height="500" /></p>
<p style="text-align: center;"><a href="https://chart.googleapis.com/chart?chs=500x500&amp;chld=L|1&amp;cht=qr&amp;chl=https://schoberg.net/qr" id="qrLink" title="Download QR Code Image"><img id="qrImage" src="https://chart.googleapis.com/chart?chs=500x500&amp;chld=L|1&amp;cht=qr&amp;chl=https://gratisqr.com" /></a><br /><small>(Right Click &gt; Save Image As...)</small></p>
<p>I wrote this simple script (that uses the free <a href="https://developers.google.com/chart/infographics/docs/qr_codes" target="_blank" rel="noopener">google charts api</a>) because I like QR Codes and I hate that everyone over complicates this.</p>
<p>Many of the "fancy" generators (that you often have to pay for) stylize the QR Code too much, making them hard to scan by many phones. Just keep it simple and use a clean QR code. Enter your URL or whatever else you want and this will output the easiest to scan QR Code for you. Fast, east, and 100% free.</p>
<p>
<script>document.getElementById('qr').addEventListener('input', function(event) {
            const inputValue = event.target.value;
            
            if (inputValue === '') {
                document.getElementById('qrImage').src = 'https://chart.googleapis.com/chart?chs=500x500&chld=L|1&cht=qr&chl=https://gratisqr.com';
            } else {
                const encodedInputValue = encodeURIComponent(inputValue);
                const imageUrl = 'https://chart.googleapis.com/chart?chs=500x500&chld=L|1&cht=qr&chl=' + encodedInputValue;
                document.getElementById('qrImage').src = imageUrl;
                document.getElementById('qrLink').href = imageUrl;
            }
        });</script>
</p>]]></content:encoded>
   <category>Code</category>
   <pubDate>Sun, 07 May 2023 12:00:00 -0500</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/better-strikethrough-strikeout-style-good-for-prices-with-css</guid>
   <title>Better Strikethrough / Strikeout Style (good for prices) with CSS</title>
   <link>https://schoberg.net/better-strikethrough-strikeout-style-good-for-prices-with-css</link>
   <description>This code will show you how to make a more style and readable &quot;strikeout&quot; style of text. Good for showing pricing discounts etc. The strike line</description>
   <content:encoded><![CDATA[<p>This code will show you how to make a more style and readable "strikeout" style of text. Good for showing pricing discounts etc.</p>
<p>The strike line adjusts in thickness to match your font size and it slightly transparent to help with readability.</p>
<p class="codepen" data-height="300" data-default-tab="html,result" data-slug-hash="PoPVaob" data-user="schoberg" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen <a href="https://codepen.io/schoberg/pen/PoPVaob"> Better Strikethrough / Strikeout Style (good for prices) </a> by Jesse Schoberg (<a href="https://codepen.io/schoberg">@schoberg</a>) on <a href="https://codepen.io">CodePen</a>.</span></p>
<p>
<script src="https://cpwebassets.codepen.io/assets/embed/ei.js" async=""></script>
</p>
<p>You can see the code in the above pen. In short we've removed the <code>text-decoration</code> and used the <code>::before</code> pseudo-element to create a nice angled line that even has rounded ends that you can observe at larger font sizes.</p>]]></content:encoded>
   <category>Code</category>
   <pubDate>Fri, 22 May 2020 12:00:00 -0500</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/fast-agile-youtube-embed-responsive-iframe-load-delay-with-jquery</guid>
   <title>Fast &amp; Agile YouTube Embed - Responsive iFrame load delay with jQuery</title>
   <link>https://schoberg.net/fast-agile-youtube-embed-responsive-iframe-load-delay-with-jquery</link>
   <description>This code is an alternative to the traditional YouTube  embed. It will reduce the downloads of each embeded video by about 90% and have them resize</description>
   <content:encoded><![CDATA[<p>This code is an alternative to the traditional YouTube <code>&lt;iframe&gt;</code> embed. It will reduce the downloads of each embeded video by about 90% and have them resize responsively to all screen widths. It is made with <code>jQuery</code>, <code>HTML</code>, and <code>CSS</code>.</p>
<blockquote>Great news! <a href="https://twitter.com/efranks06">Eric Franklin</a> has <a href="https://wordpress.org/plugins/video-embed-optimizer/">created a WP Plugin using my code</a> and added Vimeo support.</blockquote>
<h2>Background</h2>
<p>I noticed that YouTube <code>&lt;iframe&gt;</code> embeds are really slow. Upon investigation they are <strong>~450kb for each embed</strong>. This is not the video, just the "ready to play" player. If you have a few videos on a page this could be loading a few mb of data for videos that never even get played.</p>
<h2>The Solution</h2>
<p>The idea is simple. Only load the screen shot of the video with a play button, then load the player only <em>after</em> it's been clicked. This essentially <strong>reduces each instance from ~450kb to about ~30kb</strong>.</p>
<p>With a bit of research I found out I was not the only one with this idea. However, no one had put together a comprehensive solution that was up to the current coding standards and fully responsive. My version is based off of the <a href="http://www.sitepoint.com/faster-youtube-embeds-javascript/">code of Alexis Ulrich</a> who had a pretty good version of this.</p>
<h2>Working Example &amp; Code</h2>
<p class="codepen" data-height="300" data-default-tab="html,result" data-slug-hash="pJBVqO" data-user="schoberg" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen <a href="https://codepen.io/schoberg/pen/pJBVqO"> Fast &amp; Agile YouTube Embed</a> by Jesse Schoberg (<a href="https://codepen.io/schoberg">@schoberg</a>) on <a href="https://codepen.io">CodePen</a>.</span></p>
<p>
<script src="https://cpwebassets.codepen.io/assets/embed/ei.js" async=""></script>
</p>
<h2>Usage</h2>
<ol>
<li>You must have jQuery running on your page. This can be done by <a href="https://developers.google.com/speed/libraries/?hl=en#jquery">including a single line of code that pulls from the Google CDN as shown here</a>.</li>
<li>Any spot you want to include a video simply put in the <code>&lt;div&gt;</code> as shown above on the <code>HTML</code> tab. Just set the <code>id</code> of the <code>&lt;div&gt;</code> to the ID of the video on YouTube.</li>
<li>The first <code>HTML</code> example just shows the standard embed. If you'd like to <a href="https://developers.google.com/youtube/player_parameters?hl=en#Parameters">get fancy and add some parameters</a>, you can by adding them to the div's <code>data-params</code> attribute as shown in the second example.</li>
<li>Add the <code>CSS</code> shown to your style sheet.</li>
<li>Add the <code>javascript</code> to your existing <code>.js</code>&nbsp;file, or directly into a <code>&lt;script&gt;</code> tag.</li>
</ol>
<h2>Notes</h2>
<ul>
<li>Works on all screen widths while keeping the correct dimensions of the video. However, on mobile the user will have to tap a second time due to YouTube disabling "autoplay" on mobile. (I think this is a minor inconvenience for the data saved)</li>
<li>Early versions of the responsive video concept I'm using have <a href="http://stackoverflow.com/a/15844571">an additional 25px</a> of height to accommodate the YouTube player bar. I have removed this as YouTube is now loading <code>HTML5</code> players and they are truly 16:9.</li>
<li>It dynamically loads the http or https version of the screen shot and the embed.</li>
<li>The thumb I'm loading is about 30kb and is the "HQ Default". If you'd like to change this based on your needs there <a href="http://www.sitepoint.com/faster-youtube-embeds-javascript/#supported-youtube-thumbnails">are some other options</a>. Just replace&nbsp;<code>hqdefault.jpg</code> in the&nbsp;<code>JS</code> code with the chosen option.</li>
<li>The "play" button is image free&nbsp;and can be edited to match your site in the <code>CSS</code>. Just be sure if you alter the <code>height/width</code> of anything you also watch the <code>margin</code> which is centering it.</li>
</ul>]]></content:encoded>
   <category>Code</category>
   <pubDate>Thu, 13 Aug 2015 12:00:00 -0500</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/simple-responsive-table-solution-for-mobile-using-jquery</guid>
   <title>Simple Responsive Table Solution for Mobile using jQuery</title>
   <link>https://schoberg.net/simple-responsive-table-solution-for-mobile-using-jquery</link>
   <description>So far I've found all the proposed solutions for dealing with wide tables on mobile to be a bit cumbersome and just not that great. Then I had the</description>
   <content:encoded><![CDATA[<p>So far I've found all the <a href="http://css-tricks.com/responsive-data-tables/">proposed</a> <a href="http://zurb.com/playground/responsive-tables">solutions</a> for dealing with wide tables on mobile to be a bit cumbersome and just not that great. Then I had the idea of wrapping the table in a div and just using overflow to make it scroll sideways without breaking the layout.</p>
<p>Turns out I wasn't the only one.. a quick search yielded <a href="http://creativeandcode.com/simple-solution-for-responsive-tables/">this post over at Creative Code</a>. The only thing I didn't really like about it is that it doesn't apply the wrapper on the fly. I don't like to add extra markup when I don't have to, especially when it's not even for all users. So I decided to make a tweak to apply the wrapper on the fly with jquery. <a href="http://www.responsinator.com/?url=http%3A%2F%2Fformtoemail.com%2Fplans.php">Here are some examples in action</a> (see the Plans table)</p>
<h2>jQuery</h2>
<pre>$(document).ready(function(){ <br />// Mobile tables<br />     if ($(window).width() &lt; 980){<br />          $("table").wrap( '&lt;div class="mogrid"&gt;&lt;/div&gt;' );<br />     }<br />});// end document.ready</pre>
<p>I used <code>980</code> as my breakpoint as that is the width of my largest desktop size, but you could set this to whatever you want. Also if you didn't want to do all tables you could replace <code>$("table")</code> with something identifying the particular tables you want to effect. Maybe like: <code>$("table.datagrid")</code></p>
<h2>CSS</h2>
<pre>.mogrid {overflow-y:auto;-webkit-overflow-scrolling: touch;}</pre>
<p>That's it! On the <a href="http://creativeandcode.com/simple-solution-for-responsive-tables/">Creative Code example</a> they use <code>overflow-y:scroll;</code> Which I replaced with <code>overflow-y:auto;</code> as that will only allow scrolling when needed opposed to all the time. Also big hat tip to them for the <code>-webkit-overflow-scrolling: touch;</code> That makes the scrolling feel great on iPhone.</p>]]></content:encoded>
   <category>Code</category>
   <pubDate>Fri, 22 Nov 2013 12:00:00 -0600</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/replace-checkbox-inputs-with-mobile-style-toggle-switches-using-jquery-and-css</guid>
   <title>Replace checkbox inputs with &quot;mobile style&quot; toggle switches using jquery and css</title>
   <link>https://schoberg.net/replace-checkbox-inputs-with-mobile-style-toggle-switches-using-jquery-and-css</link>
   <description>So as the world gets more and more mobile people are getting used to seeing the toggle switches seen on iPhone/iOS and Android user interfaces. They</description>
   <content:encoded><![CDATA[<p>So as the world gets more and more mobile people are getting used to seeing the toggle switches seen on iPhone/iOS and Android user interfaces. They are very intuitive and downright fun, and much easier to use than checkboxes. I'm working on a project that has a user interface that calls for this so I decided to extend the <a href="http://davemacaulay.com/jquery-simple-checkbox-replacement-jquery-simplecheckbox-js/">Super Simple Fancy Checkbox Plugin by Dave Macaulay</a> by cleaning it up a bit and creating some fun flat style toggle switches. Flat design is quite popular now and being the minimalist I am it's like heaven for me. You could easily alter the css on these to be more 3d with some gradients/shadows/radius.(<a href="#bonus">See "Bonus Styles" below</a>)</p>
<h2>Visual and Working Examples</h2>
<h3>What it looks like (non functioning)</h3>
<p><img class="" title="Screen Shot 2013-09-27 at 1.17.03 PM" src="https://app.dropinblog.com/uploaded/blogs/34252905/files/toggles.png" alt="" width="125" height="121" /></p>
<h3>Full Code and Working Example</h3>
<p><a href="https://schoberg.net/lab/jquery-toggle-switches/">Clean Example</a></p>
<h2>How it works</h2>
<p>This is so easy to implement.. it's fantastic. Essentially you build your form how you normally would using <code>input type="checkbox"</code> and then using a little jQuery we hide the original <code>input</code> and create a new <code>div class="tog"</code> which is the toggle. Then when you click the toggle it adds / removes <code>class="on"</code> from the element and adds/removes <code>checked</code> from the hidden input so your form will submit the data as expected :)</p>
<h2>The HTML</h2>
<p>Your form just needs to have a <code>checkbox input</code> with a <code>name</code> and <code>id</code>.</p>
<pre>&lt;input id="toggle1" type="checkbox" name="toggle1" /&gt;</pre>
<h2>The Jquery (put this in the <code>head</code> or external JS file)</h2>
<pre>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"&gt;&lt;/script&gt;<br />&lt;script&gt;<br />/* Super Simple Fancy Checkbox by davemacaulay.com updated by schoberg.net  */<br />(function( $ ) {<br />    $.fn.simpleCheckbox = function(options) {<br />        var defaults = {<br />            newElementClass: 'tog',<br />            activeElementClass: 'on'<br />          };<br />        var options = $.extend(defaults, options);<br />        this.each(function() {<br />            //Assign the current checkbox to obj<br />            var obj = $(this);<br />            //Create new element to be styled<br />            var newObj = $('<br />&lt;div/&gt;', {<br />                'id': '#' + obj.attr('id'),<br />                'class': options.newElementClass,<br />                'style': 'display: block;'<br />            }).insertAfter(this);<br />            //Make sure pre-checked boxes are rendered as checked<br />            if(obj.is(':checked')) {<br />                newObj.addClass(options.activeElementClass);<br />            }<br />            obj.hide(); //Hide original checkbox<br />            //Labels can be painful, let's fix that<br />            if($('[for=' + obj.attr('id') + ']').length) {<br /><br />                var label = $('[for=' + obj.attr('id') + ']');<br />                label.click(function() {<br />                    newObj.trigger('click'); //Force the label to fire our element<br />                    return false;<br />                });<br />            }<br />            //Attach a click handler<br />            newObj.click(function() {<br />                //Assign current clicked object<br />                var obj = $(this);<br />                //Check the current state of the checkbox<br />                if(obj.hasClass(options.activeElementClass)) {<br />                    obj.removeClass(options.activeElementClass);<br />                    $(obj.attr('id')).attr('checked',false);<br />                } else {<br />                    obj.addClass(options.activeElementClass);<br />                    $(obj.attr('id')).attr('checked',true);<br />                }<br />                //Kill the click function<br />                return false; <br />            });<br />        });<br />    };<br />})(jQuery);<br /><br />$(document).ready(function(){ <br /><br />// replace checkboxes with Toggles<br />$('input:checkbox').simpleCheckbox();<br /><br />});// end document.ready<br />// ]]&gt;&lt;/script&gt;</pre>
<p>You'll note at the very end is where I actually call it. In my example I'm hitting <strong>all checkboxes</strong>. You can easily change that by say putting <code>id="userform"</code> or whatever on your <code>form</code> tag and then replacing <code>input:checkbox</code> above with <code>#userform input:checkbox</code></p>
<h2>CSS</h2>
<pre>/* === Start Schoberg.net Toggle Switches === */<br />div.tog{display:block;margin:1em auto;height:40px;width:100px;position:relative;cursor:pointer;font:18px/18px arial;background:#ccc;<br />-webkit-transition: all .2s ease;-moz-transition: all .2s ease;-o-transition: all .2s ease;transition: all .2s ease;}<br />div.tog:after{content:'';display:block;height:30px;width:40px;background:#fff;position:absolute;top:5px;left:5px;<br />-webkit-transition: all .2s ease;-moz-transition: all .2s ease;-o-transition: all .2s ease;transition: all .2s ease;}<br />div.tog:before{content:'OFF';position:absolute;right:11px;top:12px;color:#fff;}<br />div.tog:hover:after{left:10px;}<br />div.tog.on:before{content:'ON';right:60px;}<br />div.tog.on{background:#0c0;}<br />div.tog.on:after{left:55px;}<br />div.tog.on:hover:after{left:50px;}<br />/* === End Schoberg.net Toggle Switches === */</pre>
<h2 id="bonus">Bonus Styles!</h2>
<p>OK don't dig the flat square look? <a href="https://schoberg.net/lab/jquery-toggle-switches/2.html">Here's an example of something a bit more "realistic".</a><br /><img class="" title="Screen Shot 2013-09-27 at 4.06.02 PM" src="https://app.dropinblog.com/uploaded/blogs/34252905/files/toggles2.png" alt="" width="139" height="130" /></p>
<p></p>]]></content:encoded>
   <category>Code</category>
   <pubDate>Fri, 27 Sep 2013 12:00:00 -0500</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/easy-css3-transitions</guid>
   <title>Easy css3 transitions</title>
   <link>https://schoberg.net/easy-css3-transitions</link>
   <description>You can do a lot with css3 transitions and I'm not going to get into that here. But I am going to show you a simple line of css you can start using</description>
   <content:encoded><![CDATA[<p>You can do a lot with css3 transitions and I'm not going to get into that here. But I am going to show you a simple line of css you can start using now to add a nice smooth animation to your <code>:hover</code> effects.</p>
<p>Now this can be altered to your needs, I'm using 0.2 seconds of transition and the "ease" effect. You can <a href="http://www.w3.org/TR/css3-transitions/">pop over to w3c</a> for all the gritty on property. But in short just add this to the css of any link (or other element you have associated a <code>:hover</code> with) and BAM. Nice smooth animation in everything except for IE. (IE10 will support it but that's not quite out as of this writing)</p>
<h2>The css3 transition code</h2>
<pre>-webkit-transition: all .2s ease;-moz-transition: all .2s ease;-o-transition: all .2s ease;-ms-transition: all .2s ease;transition: all .2s ease;</pre>
<h2>css3 transitions working example</h2>
<p>Here is a <a href="https://jsbin.com/rajohifico/edit?html,css,output" target="_blank" rel="noopener">working comparison example</a> over at jsbin.</p>]]></content:encoded>
   <category>Code</category>
   <pubDate>Tue, 01 May 2012 12:00:00 -0500</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/php-shorthand-conditional-statement</guid>
   <title>PHP Shorthand Conditional Statement</title>
   <link>https://schoberg.net/php-shorthand-conditional-statement</link>
   <description>Here's another quick hit from my php snippets. You can see a review of a lot of ways to do this on David Walsh's post on the subject. However, I</description>
   <content:encoded><![CDATA[<p>Here's another quick hit from my php snippets. You can see a review of a lot of ways to do this on <a href="http://davidwalsh.name/javascript-shorthand-if-else-examples">David Walsh's post on the subject</a>. However, I wanted to write it as short as possible to be used within pages. I use this a lot to add css classes into tags.</p>
<h2>The if/else shorthand php snippet</h2>
<pre>&lt;?=$age=='old'?'Hi Old Guy':'Hi Youngster';?&gt;</pre>
<h2>The breakdown of the statement in a diagram</h2>
<p><img class="" title="php shorthand diagram" src="https://app.dropinblog.com/uploaded/blogs/34252905/files/phpshorthand1.png" alt="php shorthand diagram" width="580" height="119" /></p>
<p>In this example we say "if the <code>$age</code> is old" then echo "Hi Old Guy" else echo "Hi Youngster". The syntax highlighting is not perfect since I'm using the shorthand open and closing php tags. But this is the absolute shortest you can make this statement. You'll also notice I'm using single quotes. This is handy because then you do not need to escape double quotes like in the example below that I use a lot for adding a class to a tag.</p>
<h2>Adding a class to a tag with a php shorthand statement</h2>
<pre>&lt;a href="about.php" &lt;?=$page=='about'?'class="now"':'';?&gt;&gt;About Us&lt;/a&gt;</pre>
<p></p>
<p>In this example I have a simple anchor tag for my "About Us" menu item. Then I've put in the conditional statement indicating if the <code>$page</code> variable is equal to "about" then echo <code>class="now"</code>. Then of course you will have some additional styling put onto your <code>.now</code> class to indicate the current page. Then in the top of your <code>about.php</code> file you just have to set the <code>$page</code> variable to <code>$page='about';</code>.</p>
<p></p>]]></content:encoded>
   <category>Code</category>
   <pubDate>Mon, 30 Apr 2012 12:00:00 -0500</pubDate>
  </item>
  <item>
   <guid>https://schoberg.net/php-conditional-statement-in-between-dates</guid>
   <title>PHP Conditional Statement - In Between Dates</title>
   <link>https://schoberg.net/php-conditional-statement-in-between-dates</link>
   <description>I'm always using little php snippets in tons of projects. Here's one I needed today that is very useful.  If you want a specific item to show only</description>
   <content:encoded><![CDATA[<p>I'm always using little php snippets in tons of projects. Here's one I needed today that is very useful.&nbsp; If you want a specific item to show only between a group of dates you can use this. No big function, just slap in your dates and go!</p>
<pre>&lt;?php if (date('Ymd') &amp;gt;= '20120120' and date('Ymd') &amp;lt;= '20120125' ): ?&gt;<br />Show the promo banner<br />&lt;?php else: ?&gt;<br />Show the normal banner<br />&lt;?php endif; ?&gt;</pre>
<p>So in English that says.. if today&rsquo;s date is greater than or equal to 2012-01-20 and it&rsquo;s less than or equal to 2012-01-25 show the promo banner. Otherwise show the normal banner.</p>
<p>Or if you only want to show the promo banner during some dates and do not have alternative content you can just end the statement like this:</p>
<pre>&lt;?php if (date('Ymd') &amp;gt;= '20120120' and date('Ymd') &amp;lt;= '20120125'): ?&gt;<br />Show the promo banner<br />&lt;?php endif; ?&gt;</pre>
<p></p>]]></content:encoded>
   <category>Code</category>
   <pubDate>Fri, 20 Jan 2012 12:00:00 -0600</pubDate>
  </item>
 </channel>
</rss>
