Skip to content

Instantly share code, notes, and snippets.

View iandouglas's full-sized avatar

w. ian douglas iandouglas

View GitHub Profile
@iandouglas
iandouglas / scene-switch.py
Created June 1, 2022 20:53
scene switcher in OBS
import obspython as obs
import random
def cycle():
# get a list of all scenes from OBS
scenes = obs.obs_frontend_get_scenes()
# get current scene
current_scene = obs.obs_frontend_get_current_scene()
@iandouglas
iandouglas / readme.md
Last active September 8, 2023 09:56
Use LinkedIn to get Introductions through your network

LinkedIn Introductions

If you find a company where you're interested in researching to eventually apply for work, here are some steps you can follow to see if any of your existing LinkedIn connections know someone at the company, or know someone who knows someone, etc.

Instructions

(instructions are accurate as of late May 2022, but subject to change if LinkedIn changes their UI)

  1. View a LinkedIn profile of someone in your network. (eg, https://linkedin.com/in/iandouglas736)
  2. Near the top of their profile you should see how many connections they have (or just "500+ connections" if they have a big network). Click on that as a link. (it won't be a clickable link unless you're already connected with them)
@iandouglas
iandouglas / linkedin-intros.md
Last active September 21, 2021 16:13
Can an Instructor introduce me to someone at a company via LinkedIn?

LinkedIn Introductions

If you find a company where you're interested in applying for work, here are some steps you can follow to see if any of your instructors know someone at the company, or know someone who knows someone, etc.

(instructions are accurate as of late August 2020, but subject to change if LinkedIn changes their UI)

  1. Connect with your instructor via LinkedIn. (eg, https://linkedin.com/in/iandouglas736)
  2. Once connected, click on your instructor's profile.
  3. In their profile you should see how many connections they have (or just "500+ connections"). Click on that as a link. (it won't be a clickable link until you're directly connected with your instructor)
  4. Click on the "Current companies" dropdown at the top, and type in the name of the company and click Apply.
@iandouglas
iandouglas / README.md
Last active November 28, 2020 23:41
Debugging PostgreSQL problems

I got 99 problems and PostgreSQL is EVERY SINGLE ONE OF THEM!

I put together these notes to help diagnose and repair PostgreSQL installations and other problems.

Step One -- how did you install the app?

You either installed it via Homebrew, or you installed it via download at postgresapp.com. Either is fine. Most problems I see with PostgreSQL come from Homebrew.

If you installed BOTH you need to decide which one to remove.

@iandouglas
iandouglas / cr10mini_prusaslicer_configbundle.ini
Created April 18, 2020 07:44
PrusaSlicer CR10 Mini Config Bundle
# generated by PrusaSlicer 2.2.0+ on 2020-04-18 at 07:37:36 UTC
[print:Creality CR10 Mini]
avoid_crossing_perimeters = 0
bottom_fill_pattern = rectilinear
bottom_solid_layers = 3
bottom_solid_min_thickness = 0
bridge_acceleration = 0
bridge_angle = 0
@iandouglas
iandouglas / README.md
Created February 11, 2019 04:27
Turing Mod 2 Backend, Rails 5.1 FactoryBot examples

Terminology:

  • ... means "whatever else is already here", don't actually input three dots!

To get started, add the following gem in your Gemfile in the :development, :test group, and run 'bundle update'

group :development, :test do
@iandouglas
iandouglas / README.md
Last active March 21, 2024 12:44
Intro to Co-Authored Git Commits

Intro to Co-Authored Git Commits

Why

In student projects, I commonly look at contribution graphs to see how much code they worked on, to get an idea if one student is doing more work than others on the project. This can be used for coaching and performance grading.

How

Start with your ~/.gitconfig file in your home folder. Add these lines:

@iandouglas
iandouglas / README.md
Created September 7, 2018 14:33
mcOS X High Sierra, Rails and PostgreSQL installation notes

The "High Sierra" build of macOS X removed a legacy folder path where some library files are generally installed for tools that need to be compiled. If you click on the 'apple' icon in the top left corner of your screen, if the text in large font says something like "macOS High Sierra" then this set of instructions could help fix some problems for you.

If you have installed PostgreSQL before upgrading to High Sierra, this may not affect you and these installation notes may not help.

If your Macbook came with High Sierra, or you've upgraded to High Sierra before installing PostgreSQL, this may affect you and you can keep reading.

Assumptions:

  • you're using Homebrew
@iandouglas
iandouglas / scraper.rb
Created August 10, 2018 19:06
Scraping GitHub pull requests using Ruby
# determine if a user has made a pull request (or several), returning a JSON payload either way
require 'nokogiri'
require 'open-uri'
require 'json'
student = '' # 'iandouglas'
repo = 'turingschool/portfolios'
doc = Nokogiri::HTML(open("https://github.com/#{repo}/pulls"))

Why isn't using POST for everything considered RESTful?

Context/Rephrasing: Why can't we use POST as the HTTP verb for every request/response in the HTTP request/response cycle?

In the mid-90's, when the web was new, everything was a GET or a POST. Through developing the HyperText Transport Protocol (HTTP) it was determined that this wasn't flexible enough, and opened many other HTTP methods (aka "verbs") such as PUT, PATCH and DELETE.

Even today, when the "web" is more than 20 years old, <form> tags will still only send data using GET or POST, but modern frameworks have a bit of a way around that, and there are other ways using JavaScript to send data using other methods/verbs.

When we consider how "endpoints" (URIs) are built in our applications, it's far easier to say "if I'm trying to GET this URI" or "I'm trying to DELETE something based on this URI" by having several different endpoints with short blocks of code, like this: