Skip to content

Commit

Permalink
update css & html
Browse files Browse the repository at this point in the history
  • Loading branch information
liz-muehlmann committed Oct 3, 2022
1 parent 25f3c84 commit 85a28ed
Show file tree
Hide file tree
Showing 142 changed files with 13,547 additions and 897 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I"�{"source"=>"C:/Users/lizmo/Desktop/sandbox", "destination"=>"C:/Users/lizmo/Desktop/sandbox/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/:categories/:year/:month/:day/:title:output_ext"}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>true, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>[], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>"/", "show_dir_listing"=>false, "permalink"=>"date", "paginate_path"=>"/page:num", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>[1, 2, 3, 4, 5, 6], "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false, "syntax_highlighter"=>"rouge", "syntax_highlighter_opts"=>{:default_lang=>"plaintext", :guess_lang=>true}, "coderay"=>{}}, "title"=>"Liz Muehlmann", "email"=>"[email protected]", "description"=>"Academic website for Liz Muehlmann. PhD Candidate in Political Science at the University of Irvine, California.", "url"=>"http://localhost:4000", "twitter_username"=>"@hello_iamliz", "github_username"=>"liz-muehlmann", "author"=>"Liz", "watch"=>true, "livereload_port"=>35729, "serving"=>true}:ET
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
I"<p>Version control is helpful when you want to track your project’s changes. However, GitHub has one major (yet, understandable) shortcoming: file size. The free version of GitHub will warn you if your file is over 50MB and completely reject your push if the file is over 100MB. This is a huge problem when you’re working with shapefiles (.shp) which contain the geographic coordinates necessary for cartography. “Officially” there are three ways around GitHub’s file size limits, but I have a clear favorite.</p>

:ET
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
I"&<p>Version control is helpful when you want to track your project’s changes. However, GitHub has one major (yet, understandable) shortcoming: file size. The free version of GitHub will warn you if your file is over 50MB and completely reject your push if the file is over 100MB. This is a huge problem when you’re working with shapefiles (.shp) which contain the geographic coordinates necessary for cartography. “Officially” there are three ways around GitHub’s file size limits, but I have a clear favorite.</p>

<!--more-->
<ol><li>Pay for GitHub Premium </li>
<li>LFS (Large File Storage) </li>
<li> DVC (Data Version Control) </li></ol>

<p>My favorite is using DVC, so I’m only going to go over #1 and #2 briefly.</p>

<h2><u>GitHub Pro</u></h2>
<p>GitHub has a paid-version which is available <a href="https://github.com/pricing">here</a>. It starts at $48 a year. Both the free and pro versions have repo limit of 2GB, Team version limits it to 4GB, and enterprise limits files to 5GB.</p>

<p>You still can’t push files larger than 100MB, so unless you’re doing a lot of programming I don’t think the Pro version is worth it. I would suggest checking if your school or employer offers an enterprise account. My school does not.</p>

<h2><u>LFS [Large File Storage]</u></h2>
<p><a href="https://git-lfs.github.com/">LFS</a> is a way around GitHub’s file size limits when pushing changes. To install LFS just go to the website and download it.</p>

<p>You will need to use the command line to use LFS, but it’s fairly straightforward. Once you’ve downloaded <a href="https://git-lfs.github.com/">LFS</a> and install it you’ll need to open a console or terminal. Powershell on Windows, terminal on Mac, <a href="https://cmder.app">cmder</a> console emulator, or any other command line interface will work.</p>

<p>First you’ll need to navigate to wherever you store your repos and install LFS:</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
</pre></td><td class="code"><pre><span class="w"> </span><span class="n">cd</span><span class="w"> </span><span class="nx">Documents\Github</span><span class="w">
</span><span class="n">git</span><span class="w"> </span><span class="nx">lfs</span><span class="w"> </span><span class="nx">install</span>
</pre></td></tr></tbody></table></code></pre></figure>

<p>The basic logic of LFS is to track certain file extensions so that Git ignores them, but LFS does not.</p>

<p>For example, I know that .shp files are very large. I would track all .shp files using LFS to get around the file size limit. To track an extension with LFS you use:</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><span class="w"> </span><span class="n">git</span><span class="w"> </span><span class="nx">lfs</span><span class="w"> </span><span class="nx">track</span><span class="w"> </span><span class="s2">"*.shp"</span></code></pre></figure>

<p>The <code>*</code> before .shp tells LFS to add any file, regardless of what it’s called, that has the .shp extension.</p>

<p>The final step is to make a .gitattributes file.</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><span class="w"> </span><span class="n">git</span><span class="w"> </span><span class="nx">add</span><span class="w"> </span><span class="o">.</span><span class="nf">gitattributes</span></code></pre></figure>

<p>Once you follow those steps, you can use Git and GitHub as you normally would.</p>

<p>The problem with this option is that it does not get around GitHub’s limit on total repos size. You’ll still be limited to repos no larger than 2GB. This is a problem if you’re doing a complex cartography project with multiple .shp files or you’re mapping data from something like the <a href="https://cces.gov.harvard.edu/explore">CES.</a> The only way around this, that I’ve found, is to use DVC [data version control].</p>

<h2><u>DVC [Data Version Control]</u></h2>
<p>DVC is an open-source version control system for data. It works in parallel with Git.</p>

<p>To start, you need to download and install DVC from <a href="https://dvc.org/">here</a>. Once you do, navigate to the repo that has large files and initialize DVC:</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
</pre></td><td class="code"><pre><span class="w"> </span><span class="n">cd</span><span class="w"> </span><span class="nx">Documents\Github</span><span class="w">
</span><span class="n">dvc</span><span class="w"> </span><span class="nx">init</span>
</pre></td></tr></tbody></table></code></pre></figure>

<p>Once you initialize DVC several files are created. You’ll need to push the new files to GitHub</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
3
</pre></td><td class="code"><pre><span class="w"> </span><span class="n">git</span><span class="w"> </span><span class="nx">add</span><span class="w"> </span><span class="nt">-A</span><span class="w">
</span><span class="n">git</span><span class="w"> </span><span class="nx">commit</span><span class="w"> </span><span class="nt">-m</span><span class="w"> </span><span class="s2">"Initialize DVC"</span><span class="w">
</span><span class="n">git</span><span class="w"> </span><span class="nx">push</span><span class="w"> </span><span class="nx">origin</span><span class="w"> </span><span class="nx">main</span>
</pre></td></tr></tbody></table></code></pre></figure>

<p>To actually track data you’ll need to add them to DVC. It’s done in much the same way as using Git in command line.</p>

<p>To add an individual file you’d use:</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
</pre></td><td class="code"><pre><span class="w"> </span><span class="n">dvc</span><span class="w"> </span><span class="nx">add</span><span class="w"> </span><span class="nx">data/filename.ext</span>
</pre></td></tr></tbody></table></code></pre></figure>

<p>where [filename.ext] is the name of your file or the directory you want to track.</p>

<p>Before you can push changes to DVC, you’ll need to add a remote storage site. My school gives us a lot of storage through Google and Microsoft, so I connected my DVC to my Google Drive.</p>

<p>If, like me, you want to use Google Drive I suggest making a folder called “DVC” on your Google Drive and using it to store your DVC files.</p>

<p>To use the folder you created, you’ll need to add the remote using the command line.</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
</pre></td><td class="code"><pre><span class="w"> </span><span class="n">dvc</span><span class="w"> </span><span class="nx">remote</span><span class="w"> </span><span class="nx">add</span><span class="w"> </span><span class="nt">-default</span><span class="w"> </span><span class="p">[</span><span class="n">remote</span><span class="nt">-name</span><span class="p">]</span><span class="w"> </span><span class="nx">\</span><span class="w"> </span><span class="nx">gdrive://</span><span class="p">[</span><span class="n">folder</span><span class="nt">-ID</span><span class="p">]</span><span class="w">
</span><span class="n">dvc</span><span class="w"> </span><span class="nx">push</span>
</pre></td></tr></tbody></table></code></pre></figure>

<p>[remote-name] is whatever you want to save the drive URL to. It’s easiest just to name it “myremote” but it’s up to you.</p>

<p>The [Folder-ID] is the jumble of letters and numbers at the end of the URL. To get it, you’ll need to navigate to the folder you want to use on Google Drive in your browser. At the top you’ll see the URL and you’ll need to copy the bit after the last /.</p>

<p><a href="/assets/notes-images/using-github/using-github-21.jpg">
<img src="/assets/notes-images/using-github/using-github-21.jpg" alt="Repo Options" class="img-fluid" /></a></p>

<p>You only need to do this step once.</p>

<p>When you’re ready to use DVC all you do is add the file you want and push it.</p>

<figure class="highlight"><pre><code class="language-powershell" data-lang="powershell"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
</pre></td><td class="code"><pre><span class="w"> </span><span class="n">dvc</span><span class="w"> </span><span class="nx">add</span><span class="w"> </span><span class="p">[</span><span class="n">filename</span><span class="p">]</span><span class="w">
</span><span class="n">dvc</span><span class="w"> </span><span class="nx">push</span>
</pre></td></tr></tbody></table></code></pre></figure>

<h2><u>Conclusion</u></h2>
<p>DVC is feature-rich and useful. It allows you to store your data in the same repo without running into GitHub’s file size limits. The <a href="https://dvc.org/doc/start/data-management"> documentation for DVC </a>is well written, so I suggest looking at it if you want to use another storage site like Microsoft One Drive or Dropbox</p>

<p>With all the data management and version control sorted you can turn, in earnest, to <a href="https://liz-muehlmann.github.io/notes/cartography-part-one">cartography in R!</a></p>
:ET
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
I"n<p>
This area will not be a real blog, in the sense that it will probably not have regular updates.
</p>
:ET
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
I"F<p>Building off my post about using <a href="https://liz-muehlmann.github.io/notes/git-github">Git &amp; GitHub</a>, this post is about using the GitHub website to initialize repos and get URLs from existing repos to clone them.</p>

<!--more-->

<h2><u>Web Interface</u></h2>
<p>Once you sign into <a href="https://github.com">GitHub</a> you’re greeted with a page that looks like this:</p>

<p><a href="../assets/notes-images/using-github/using-github-1.jpeg">
<img src="/assets/notes-images/using-github/using-github-1.jpeg" alt="Github Home Screen" class="img-fluid mx-auto d-block" /></a>
<i>Note:</i> Clicking on an image will open it in ths same tab.</p>

<p>On the left-hand side you’ll see a list of your repos. Clicking on any of those links will take you to the repos main page.</p>

<p>In the center are announcements and updates from repos you follow.</p>

<p>On the right are your latest changes and a list of repos that might be interesting to you.</p>

<h2><u>Initializing a Repo</u></h2>
<p>To initialize a repo using the website, you’ll click on the green button on the left that says <i>New</i>. (I boxed it in red in the above photo).</p>

<p>When you click <i>new</i> you’ll be asked to fill in some information:
<a href="../assets/notes-images/using-github/using-github-2.jpeg">
<img src="/assets/notes-images/using-github/using-github-2.jpeg" alt="Repo Options" class="img-fluid" /></a></p>

<h5>1:</h5>
<p>In the box that opens, you’ll enter a repo name. This should be a descriptive, unique-to-you name for your repo. You can’t have two repos named “project.” Just choose something short and descriptive. Here, I named my repo using-git to store the information related to this post.</p>

<h5>2:</h5>
<p>The second part of initializing a repo is to give it a description. As it says, this step is optional, but I suggest giving it a useful description. I like to add an overview of what the project is about and what still needs to be done.</p>

<h5>3:</h5>
<p>Next, you can select whether you want the repo to be public or private. If you want people to see your work and your changes, choose public. If you’re working on data for a paper you want to publish or don’t want to share your code, select private. Most of my repos are private because they are projects I’m working on that I hope to publish.</p>

<h5>4:</h5>
<p>The README file operates like the description, but in a file rather than just on GitHub. I basically add a README that gives more information including any citations, where to look for other resources, and any other information that’s useful but not vital to the repo.</p>

<h5>5:</h5>
<p>A .gitignore file is a special file. It tells Git to ignore files and directories listed in the .gitignore document. You can tell git to always skip files with a certain extension. So if you want to share your data but not your R code you can select R from the .gitignore template and GitHub will skip any file with the .R extension.</p>

<h5>6:</h5>
<p><a href="https://www.fastcompany.com/3014553/what-coders-should-know-about-copyright-licensing#:~:text=On%20GitHub%20the%20three%20main%20types%20of%20software%20licenses%20are%3A&amp;text=It%20permits%20users%20to%20do,grants%20patent%20rights%20to%20users.">Fast Company</a> has a good write up on what the licenses mean. I usually initialize with no license because my repos are private. I know creative commons is useful if you’re okay with people having full access to your code and modifying it in anyway they want.</p>

<h5>7:</h5>
<p>Finally, click Create Repository. Congrats! You now have a new project repo.</p>

<h2><u>Cloning a Repo</u></h2>
<p>Once you create a repo, you’ll want to add it to your hard drive. You can do this with your own repo or one created by another person. The steps are the same.</p>

<p>You’ll navigate to the URL of the repo. This will always follow the same format:</p>

<p>https://github.com/[username]/[reponame]. For example, my election guide repo is found at <a href="https://github.com/liz-muehlmann/Election_Guides">https://github.com/liz-muehlmann/Election_Guides</a>.</p>

<p><a href="../assets/notes-images/using-github/using-github-10.jpeg">
<img src="/assets/notes-images/using-github/using-github-10.jpeg" alt="Github Home Screen" class="img-fluid mx-auto d-block" /></a></p>

<p>To clone a repo to your hard drive you’ll need the repo URL. Click on the green <i>code</i> button and copy the URL under HTTPS.</p>

<p>You can either clone it using <a href="./notes/_posts/2022-09-17-git-github.md">command line</a> or <a href="./notes/_posts/2022-09-18-github-desktop.md">Github Desktop</a></p>

<h2><u>Conclusion</u></h2>
<p>The website is useful because you can find cool projects where people share their code and try to get answers for bugs they’re encountering. A lot of programs people use on a daily basis have project Repos. Some of my favorite extensions and plug-ins have been found by searching online for repos.</p>

<p>For example, Leaflet (the package I use for Cartography) has its own <a href="https://rstudio.github.io/leaflet/">website hosted through GitHub Pages</a> and its own <a href="https://github.com/rstudio/leaflet">GitHub repo</a> where you can fork the project or submit an issue.</p>

<p>GitHub is a powerful resource and it looks great on resumes as a skill. It looks more intimidating than it is, but you should definitely spend some time using version control.</p>

<p>I have a guide here about using version control via <a href="https://liz-muehlmann.github.io/notes/git-github">command line</a> and <a href="https://liz-muehlmann.github.io/notes/github-desktop">via GitHub desktop</a></p>
:ET
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
I"�<p>
This area will not be a real blog, in the sense that it will probably not have regular updates.
<!--more--> </p>
<p>Instead, this space is for various notes on things that catch my interest.
<br /><br />
As a first generation PhD student there are a lot of things I wish I knew. Additionally, it’s also a place where I can share my process as I go through the projects I’m working on.</p>

:ET
Loading

0 comments on commit 85a28ed

Please sign in to comment.