Skip to content

Instantly share code, notes, and snippets.

@evanwill
evanwill / gitBash_windows.md
Last active April 26, 2024 03:58
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@evanwill
evanwill / map-js.html
Last active January 11, 2024 17:38
collectionbuilder map-js.html customization
{%- if site.data.theme.icons -%}{% assign icons = site.data.theme.icons %}{% else %}
{% assign cb_icons = site.pages | where: "name","cb-icons.svg" | first %}
{% assign icons = cb_icons.icons %}{%- endif -%}
{% if site.data.theme.map-child-objects == true %}
{%- assign items = site.data[site.metadata] | where_exp: 'item','item.objectid' -%}
{% else %}
{%- assign items = site.data[site.metadata] | where_exp: 'item','item.objectid' | where_exp: 'item','item.parentid == nil' -%}
{% endif %}
{% if page.location %}
@evanwill
evanwill / README.md
Last active May 16, 2023 01:03
CollectionBuilder-GH javascript-based Timeline layout replacement

CollectionBuilder-GH javascript-based Timeline layout replacement

If you need to sort BC dates or dates < 1000 AD, using the built in Liquid sorting doesn't work. This example implements a JS based version of the Timeline instead.

  1. From your metadata's "date" field create a new column "year" that is only the year, all values must be a number. For BC dates, the year should be a negative number.
  2. In your template replace "_layouts/timeline.html" and "_includes/js/timeline-js.html" with the version in this gist.

If you want to use TimelineJS feature, you will also want to edit the "assets/data/timelinejs.json" to use item.year rather than parsing the date.

Writing in Markdown

Markdown is a quick and simple way to write formatted documents in plaintext. It is easy to read as plaintext, but is designed to convert to HTML for easy web publishing. Writing in plaintext rather than proprietary formats such as Word has many advantages:

  • simple - dont waste time in complex and frustrating formatting in Word that will be deleted by publishers anyway. This keeps your distractions to a minimum.
  • sharable - any device can open and read plaintext.
  • preservable - markdown is plaintext which is easy for digital preservation, unlike Word.
  • version controlable - you can use the full power of Git or other version control systems.

PocketCHIP stuff

Utility

build in calculator: xcalc

use the built in browser: surf http://google.com (need help, man surf)

get a text browser: sudo apt-get install lynx

@evanwill
evanwill / osxOpenRefine.md
Last active March 29, 2021 10:03
installing OpenRefine on Mac

Install OpenRefine on Mac

Mac seems to have a few issues when trying to install OpenRefine. The official instructions are on the OpenRefine wiki, but this list brings together resources to trouble shoot some common issues.

  1. Open Refine needs Java JRE. OS X has a few issues with Java, many are documented at Oracle Java on Mac OS X. Older versions of Java are automatically disabled by OS X. Its best to go to the Java page and just download and install the most up-to-date version for Mac.
@evanwill
evanwill / dualpythonnotebook.md
Created June 3, 2016 19:16
add more kernels to python 3 jupyter notebooks with anaconda

this assumes you have installed Python 3 via Anaconda distribution.

Make Python 2 kernel available to Jupyter Notebook

  1. open a terminal and create a new python 2 environment: conda create -n py27 python=2.7
  2. activate the environment: linux source activate py27 or windows activate py27
  3. install the kernel in the env: conda install notebook ipykernel
  4. install the kernel for outside the env: ipython kernel install --user
  5. close the env: source deactivate

Using Cygwin

Cygwin is a project that adds Unix style terminal to Windows. It includes hundreds of Unix commandline utilities built and packaged to function natively on Windows. It includes more functionality than Git Bash (included with Git for Windows) and is open-source (unlike MobaXterm). If you are currently using Git Bash on Windows, you may want to move to Cygwin if you would like Nano Editor, wget, and GNU Make.

Install Cygwin

Download the current installation utility from the Cygwin site.

Use Git locally to collaborate

Set up shared repository

Create a directory on the shared drive to hold the repository, then git init --bare. By convention, bare repos are given the extension .git.

cd /t/
mkdir newRepo.git
@evanwill
evanwill / flickrdownload.md
Created October 6, 2016 08:56
get stuff off flickr

Need to download metadata from flickr?

You can bulk download stuff from flickr very easily now (which is a great feature), by going to Camera Roll, selecting things, and clicking download. Or you can bulk download your sets/albums now as well. This is handy, but it doesnt export any metadata you added to the photos in the system.

Unfortunately, I found none of the apps are very stable. The most recent and least broken apps are: