<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mark Lambe</title>
    <description>The latest articles on Forem by Mark Lambe (@marklambe).</description>
    <link>https://forem.com/marklambe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F199551%2F0a79d1fb-b8be-4a4d-b715-68164ccd5fdf.jpeg</url>
      <title>Forem: Mark Lambe</title>
      <link>https://forem.com/marklambe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/marklambe"/>
    <language>en</language>
    <item>
      <title>Get some basic git stats on your lines added/removed ratio </title>
      <dc:creator>Mark Lambe</dc:creator>
      <pubDate>Mon, 30 Dec 2019 21:12:42 +0000</pubDate>
      <link>https://forem.com/marklambe/get-some-basic-git-stats-on-your-lines-added-removed-ratio-1ehm</link>
      <guid>https://forem.com/marklambe/get-some-basic-git-stats-on-your-lines-added-removed-ratio-1ehm</guid>
      <description>&lt;p&gt;These aren't the most insightful stats but sometimes I find it interesting to see what my ratio of lines added to deleted is, and you can do it with just one command. &lt;/p&gt;

&lt;p&gt;Simply run the command from &lt;a href="https://bitbucket.org/snippets/MarkLambeDev/9nbe7y"&gt;this snippet&lt;/a&gt; and you'll get your 'Lines added', 'Lines deleted', and 'Add./Del. ratio'.&lt;/p&gt;

&lt;p&gt;Don't forget to replace my name with yours, if you're not sure what it is you can just run &lt;code&gt;git config -l | grep user.name&lt;/code&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>Find out your Mac's average daily usage!</title>
      <dc:creator>Mark Lambe</dc:creator>
      <pubDate>Mon, 23 Dec 2019 20:29:17 +0000</pubDate>
      <link>https://forem.com/marklambe/find-out-your-mac-s-average-daily-usage-39h6</link>
      <guid>https://forem.com/marklambe/find-out-your-mac-s-average-daily-usage-39h6</guid>
      <description>&lt;p&gt;So I got curious about how much value I've gotten from my Mac and decided to write a script that would tell me how many hours per day I've averaged since I got it, as well as how many days I've had it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MJ8T2gNS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6xsypiat746neezocy5l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MJ8T2gNS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6xsypiat746neezocy5l.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The final script isn't perfect but it's on npx so you can run it directly from there by just doing &lt;code&gt;npx mac-usage-stats&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can view the code on &lt;a href="https://github.com/MarkLambe/mac-usage-stats"&gt;Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Unfortunately there is one tiny dependency, but there's a chance you have it installed already. It's a command line tool for Mac that helps you get hard-drive info called smartctl, which you can &lt;a href="http://macappstore.org/smartmontools/"&gt;install very easily&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Alternatively if you prefer, I originally wrote it &lt;a href="https://bitbucket.org/snippets/MarkLambeDev/oA9Mq/to-get-the-average-daily-usage-of-my-mac"&gt;in Python&lt;/a&gt; and you can use that too!&lt;/p&gt;

&lt;p&gt;I find it really interesting to know how much I've used my Mac over four and a half years, and now you can too! ☺️&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>javascript</category>
      <category>python</category>
    </item>
    <item>
      <title>I wrote a python script to output your Mac's total (and Daily Average) uptime since you bought it!</title>
      <dc:creator>Mark Lambe</dc:creator>
      <pubDate>Mon, 22 Jul 2019 16:54:34 +0000</pubDate>
      <link>https://forem.com/marklambe/i-wrote-a-python-script-to-output-your-mac-s-total-and-daily-average-uptime-since-you-bought-it-ij3</link>
      <guid>https://forem.com/marklambe/i-wrote-a-python-script-to-output-your-mac-s-total-and-daily-average-uptime-since-you-bought-it-ij3</guid>
      <description>&lt;p&gt;So I was curious about how much value my MacBook Pro was in a money-per-hour kinda way and decided to find out how many hours I'd used it for since I bought it.&lt;/p&gt;

&lt;p&gt;This turned out to be relatively straightforward as some commands can be run to get the info we need.&lt;/p&gt;

&lt;p&gt;The first thing we need to do is find the age of the &lt;code&gt;/private/var/db/.AppleSetupDone&lt;/code&gt; file which gets created when the Apple setup is... done (🔝 name for a file tbh).&lt;/p&gt;

&lt;p&gt;Then we get the number of hours the OS hard drive reports being used for. This limits things if you've replaced your hard drive but I'm not aware of a way around this.&lt;/p&gt;

&lt;p&gt;From there it's some pretty simple maths and we have the answer!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/MarkLambe/average_mac_daily_uptime"&gt;The code is here on Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I haven't spent a huge amount of time working on this so there could be better ways to do any of it, PR's welcome 😊&lt;/p&gt;

</description>
      <category>python</category>
    </item>
  </channel>
</rss>
