Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Currin MichaelCurrin

View GitHub Profile
View install-geckodriver.md
View install-rust.md

Install Rust

From the Install doc:

  • Unix (macOS and Linux)
    $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    $ # Previously the guide just said this:
    $ curl https://sh.rustup.rs -sSf | sh
@MichaelCurrin
MichaelCurrin / README.md
Last active Feb 6, 2022
VS Code snippets
View README.md
@MichaelCurrin
MichaelCurrin / README.md
Last active Jun 28, 2021
Raspberry Pi Servo
View README.md

Raspberry Pi Servo

How to control a 9G servo motor with a Rasp Pi and a simple Python script

Resources

The use of the servo including the wiring and script is based on this YouTube tutorial - Raspberry Pi Servo Motor Control. There are also plenty of similar videos out there.

For Arduino, see Using Servo Motors with Arduino

@MichaelCurrin
MichaelCurrin / README.md
Last active Jun 13, 2021
GitHub GraphQL - Get repos for a target GH user or org
View README.md
@MichaelCurrin
MichaelCurrin / README.md
Last active Mar 31, 2021
Python example - convert text to JSON structure #python #json
View README.md

Python example - convert text to JSON structure

The Python script below demonstrates how to use regex to match on text with a known structure to build a dictionary, then convert the output to JSON data.

The task comes from this StackOverflow question.

Rather than using a procedural approach to handle the lines one at a time and extract the relevant items, I split the text into chunks and then dealt with each using regex pattern to extract the relevant pieces. Expecting questions A and B to always be present and C and D to be there sometimes.

Note use brackets for capture groups.

@MichaelCurrin
MichaelCurrin / twitter-api-tokens.md
Last active Oct 24, 2021
Twitter API tokens for a new account
View twitter-api-tokens.md

Twitter API tokens

How to set up a Twitter dev account, register Twitter app and generate Twitter API tokens

This guide takes you through setting up a new Twitter account all the way through to generated Twitter auth tokens (aka API tokens or credentials). These tokens must be used on every request, such as fetch or create Twitter content.

Overview

  1. Register a Twitter account.
  2. Apply for a Twitter developer account.
@MichaelCurrin
MichaelCurrin / README.md
Last active Oct 22, 2021
Open Repo shell tool
View README.md

Open Repo shell tool

Open the current git repo directory on GitHub in your default browser.

Run this in a directory within a local git repo. The directory will be opened in your browser such as on GitHub.

Features

  • Works for any user or org, as long as .git directory exists at some level.
  • Recognizes subdirectories.
View install-jekyll.md

Install Jekyll

Prerequisites - install Ruby and Bundler globally for your user.

Install Jekyll in a project

Jekyll 3.9

This is the version that runs on GH Pages.

@MichaelCurrin
MichaelCurrin / jekyll-new.md
Last active Jan 22, 2022
Set up a new Jekyll project
View jekyll-new.md

Set up a new Jekyll project

This short guides shows you how to setup a new skeleton Jekyll project, using the Jekyll CLI to generate the files for you.

This guide does not require Jekyll to be installed globally. Rather, it takes you through installing Jekyll in a new project that only has one file in it, then uses that project Jekyll to create all the Jekyll base files in the same directory.

Under Jekyll docs, you can see the Installation page. That provides links to install for each OS. These are covered in some detail here.

See also New under my Jekyll recipes for a few ways to set up a new Jekyll site.