<?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>DEV Community: sucrose</title>
    <description>The latest articles on DEV Community by sucrose (@sucrose).</description>
    <link>https://dev.to/sucrose</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%2F189473%2F9f3ae14c-a0c2-49ca-a770-1b72fe18bff0.jpg</url>
      <title>DEV Community: sucrose</title>
      <link>https://dev.to/sucrose</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sucrose"/>
    <language>en</language>
    <item>
      <title>Free, Scheduled Snapshots in DigitalOcean</title>
      <dc:creator>sucrose</dc:creator>
      <pubDate>Thu, 25 Jun 2020 12:43:09 +0000</pubDate>
      <link>https://dev.to/sucrose/free-scheduled-snapshots-in-digitalocean-23mh</link>
      <guid>https://dev.to/sucrose/free-scheduled-snapshots-in-digitalocean-23mh</guid>
      <description>&lt;p&gt;DigitalOcean has been my favorite VPS hosting provider for over half a decade. Their implementation of spinning up server instances is as easy as it gets and takes merely seconds out of my ridiculous work-life. I try and take advantage of all the features they offer, including snapshots, backups, and third-party access. If you're curious as to the difference between snapshots and backups: snapshots can &lt;em&gt;only&lt;/em&gt; be generated manually, while backups run automatically.&lt;/p&gt;

&lt;p&gt;As of recently, I've commenced improvement of a digital bad habit: never seeming to have any time to generate snapshots of my droplets. DigitalOcean provides automated backups but for a small price of $1/month. It's a small price, but for those with smaller instances and budgets, you try to save money anywhere you can. This is where third-party access becomes useful. After some searching, I found BackupSheep.&lt;/p&gt;

&lt;p&gt;BackupSheep provides backup services for multiple hosting providers. Scheduling snapshots using BackupSheep, &lt;em&gt;for free&lt;/em&gt;, is the key. BackupSheep's free tier only allows for 1 backup schedule, but they don't limit features between the tiers. They provide a way for you to easily link your VPS host to their service. I actually prefer using BackupSheep as an alternative to DigitalOcean's native backups because of the flexibility and the amount of features they provide. You can store backups on your own storage (Bring-Your-Own-Storage): AWS, DropBox, Google Drive, etc. They provide timezone-aware schedules, compression of backups, 2FA, SSH access, etc. I began using them in 2018 and haven't experienced any issues.&lt;/p&gt;

&lt;p&gt;If interested, please support my blog by using my referral links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;BackupSheep: &lt;a href="https://backupsheep.com/?r=355gaioj"&gt;https://backupsheep.com/?r=355gaioj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;DigitalOcean: &lt;a href="https://m.do.co/c/51758bf4d433"&gt;https://m.do.co/c/51758bf4d433&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>server</category>
      <category>data</category>
      <category>backup</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How to integrate Font Awesome into a C# WPF Application (Visual Studio 2019)</title>
      <dc:creator>sucrose</dc:creator>
      <pubDate>Tue, 02 Jul 2019 18:12:11 +0000</pubDate>
      <link>https://dev.to/sucrose/how-to-integrate-font-awesome-into-a-c-wpf-application-visual-studio-2019-1emn</link>
      <guid>https://dev.to/sucrose/how-to-integrate-font-awesome-into-a-c-wpf-application-visual-studio-2019-1emn</guid>
      <description>&lt;p&gt;If you're a front-end web developer, you've most certainly heard of &lt;a href="https://fontawesome.com/"&gt;Font Awesome&lt;/a&gt;. To sum it up briefly, it's a font family used primarily on the web as a quick and easy icon solution. It's distributed in a wide variety of file formats for your convenience: SVG, OTF, TTF, EOT, and WOFF/WOFF2.&lt;/p&gt;

&lt;p&gt;For this tutorial, we'll be using the OpenType (OTF) format obtained from the &lt;a href="https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started"&gt;free desktop package&lt;/a&gt;. (OpenType has several exclusive capabilities such as support for both Windows and Macintosh systems and expanded character sets. &lt;a href="https://www.fonts.com/support/faq/font-formats"&gt;Learn more&lt;/a&gt; about the differences between OpenType and TrueType.)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://fontawesome.com/download"&gt;Download&lt;/a&gt; the free official Font Awesome desktop package. (Extract the ZIP archive to a convenient location.) [&lt;a href="https://imgur.com/PyEiu1o"&gt;screenshot&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;Create a new project in Visual Studio [&lt;a href="https://imgur.com/Uf55Km0"&gt;screenshot&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;Select &lt;em&gt;WPF App (.NET Framework)&lt;/em&gt;, click &lt;em&gt;Next&lt;/em&gt;, name your project, then click &lt;em&gt;Create&lt;/em&gt; [&lt;a href="https://imgur.com/meIFFPT"&gt;screenshot&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;Inside the &lt;em&gt;Solution Explorer&lt;/em&gt; window, right-click the project name, click &lt;em&gt;Add → New Folder&lt;/em&gt; (name the folder "Fonts") [&lt;a href="https://imgur.com/Wta6iHb"&gt;screenshot&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;Right-click the &lt;em&gt;Fonts&lt;/em&gt; folder you created, click &lt;em&gt;Add → Existing Item...&lt;/em&gt;, browse to the Font Awesome directory you extracted the ZIP archive contents into, select the &lt;em&gt;"Font Awesome 5 Free-Regular-400.otf"&lt;/em&gt; file from the ...\fontawesome-free-5.8.1-desktop\otfs\ directory. You may need to change the File Dialog filter to &lt;em&gt;All Files (&lt;em&gt;.&lt;/em&gt;)&lt;/em&gt; to see the file. [&lt;a href="https://imgur.com/Dd7Aua7"&gt;screenshot&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;Right-click &lt;em&gt;App.xaml&lt;/em&gt;, click &lt;em&gt;Open&lt;/em&gt;, then in the &lt;em&gt;XAML&lt;/em&gt; window add the following line of code inside the &lt;em&gt;&amp;lt;﻿Application.Resources&amp;gt;&lt;/em&gt; tag:  &lt;code&gt;&amp;lt;FontFamily x:Key="FontAwesome"&amp;gt;/Fonts/Font Awesome 5 Free-Regular-400.otf#Font Awesome 5 Free&amp;lt;/FontFamily&amp;gt;&lt;/code&gt;  [&lt;a href="https://imgur.com/FP6Gm7n"&gt;screenshot&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;Switch to the &lt;em&gt;MainWindow.xaml&lt;/em&gt; tab, then in the &lt;em&gt;XAML&lt;/em&gt; window add the following line of code inside the &lt;em&gt;&amp;lt;﻿Grid&amp;gt;&lt;/em&gt; tag:  &lt;code&gt;&amp;lt;TextBlock x:Name="TextBlock1" FontFamily="{StaticResource FontAwesome}" Text="&amp;amp;#xf004;" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" FontSize="100"/&amp;gt;&lt;/code&gt;  [&lt;a href="https://imgur.com/I6jinU5"&gt;screenshot&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;At this point, inside the &lt;em&gt;Design&lt;/em&gt; window you'll notice a heart icon in the middle of the &lt;em&gt;MainWindow&lt;/em&gt; GUI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;br&gt;
For the &lt;em&gt;FontFamily&lt;/em&gt; property of the &lt;em&gt;TextBlock&lt;/em&gt; we used, we're linking to the static resource key we added in Step 6. (The &lt;em&gt;x:Key&lt;/em&gt; attribute value can be changed if you prefer something different.)  You must use the Unicode value of the icons in the &lt;em&gt;Text&lt;/em&gt; property for them to display properly. (Font Awesome Unicode values can be found in the &lt;a href="https://fontawesome.com/icons"&gt;icon gallery&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resource Item Scope&lt;/strong&gt;&lt;br&gt;
You're able to reference the Font Awesome resource anywhere in the application because we used &lt;em&gt;&amp;lt;﻿Application.Resources&amp;gt;&lt;/em&gt; in Step 6. If for any reason the application-wide scope is undesirable, you can instead insert the code snippet within a &lt;em&gt;&amp;lt;﻿Window.Resources&amp;gt;&lt;/em&gt; tag inside any window's XAML to confine the scope to that window only. [&lt;a href="https://imgur.com/Y6iV9nQ"&gt;screenshot&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&amp;lt;﻿Window&amp;gt;'s FontFamily&lt;/strong&gt;&lt;br&gt;
Another less popular method would be to set a &lt;em&gt;&amp;lt;﻿Window&amp;gt;'s FontFamily&lt;/em&gt; property value to the two-part font resource reference: the base uniform resource identifier (URI); and the font location reference. For example:  &lt;code&gt;FontFamily="/FontAwesome-Example;component/Fonts/#Font Awesome 5 Free Regular"&lt;/code&gt;  (The downside to this method is that every component in the window will then inherit the &lt;em&gt;FontFamily&lt;/em&gt;.) [&lt;a href="https://imgur.com/V3vo48U"&gt;screenshot&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Referencing Font Resources from Code&lt;/strong&gt;&lt;br&gt;
You can also set the FontFamily of components in your C# code. For example:  &lt;code&gt;TextBlock1.FontFamily = new FontFamily(new Uri("pack://application:,,,/"), "./Fonts/#Font Awesome 5 Free");&lt;/code&gt; This could be useful when creating components dynamically. [&lt;a href="https://imgur.com/zQm7ANY"&gt;screenshot&lt;/a&gt;]&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>wpf</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
