Skip to content

Instantly share code, notes, and snippets.

rwanyoike /
Last active Oct 10, 2020
Solution to 'minimum number of of edits needed to assert r'A+B+'
# Solve: minimum number of 'edits' needed to assert r'A+B+' in <string>
def main(string):
# count of total A's, B's
totals = {"A": 0, "B": 0}
# count of A's, B's seen (in second loop) (does not include edits)
total_seen = {"A": 0, "B": 0}
# solution/answer
solution = 0
rwanyoike /
Created Jun 10, 2020
Solarwinds 06 Session - RSK - 5Z4
import folium
def generate_beacon_map():
kenya = folium.Map(
location=[-1.28333, 36.81667],
# width=400,
# height=300,
View settings.json
"editor.emptySelectionClipboard": false,
"editor.fontFamily": "Hack, Monospace",
"editor.fontLigatures": true,
"editor.renderControlCharacters": true,
"editor.renderIndentGuides": true,
"editor.renderWhitespace": "all",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"files.insertFinalNewline": true,
View New macOS

New macOS Setup

  1. Install any available software updates
  2. Enable software update checks
  3. Disable automatic software update downloads
  4. Enable Guest User
  5. Install command line developer tools xcode-select --install
  6. Install homebrew
  7. Setup the dotfiles repo
  8. Install the BrewFile (in dotfiles repo)
View gist:91bf357856508a163b846410ded3333d
defaults write tilesize -int 44
defaults write NSGlobalDomain NSWindowResizeTime -float 0.1
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 15
defaults write NSGlobalDomain -int 1
defaults write org.n8gray.QLColorCode fontSizePoints 9
defaults write org.n8gray.QLColorCode extraHLFlags '-l'
View aggregatorNotes.json
"title": "Building Awesome CMS",
"content": "<div><div><div class=\"section-content\"><div class=\"section-inner sectionLayout--insetColumn\"><figure id=\"1b95\" class=\"graf graf--figure graf-after--h3\"><img class=\"progressiveMedia-noscript js-progressiveMedia-inner\" src=\"*zo51eqdjJ_XSU0D8Vm8P9A.png\"></figure><p id=\"c21b\" class=\"graf graf--p graf-after--figure\"><a href=\"\" class=\"markup--anchor markup--p-anchor\">Awesome CMS</a> is&#x2026;an awesome list of awesome CMSes. It&#x2019;s on GitHub, so anyone can add to it via a pull request. Here are some notes on how and why it came to be.</p><p id=\"2a96\" class=\"graf graf--p graf-after--h3\">GitHub has a <a href=\"\" class=\"markup--anchor markup--p-anchor\">set of powerful commands</a> for narrowing search results. In seeking out modern content management tools, I used queries like this:</p><p id=\"5c79\" class=\"g
rwanyoike /
Created Sep 9, 2017
Code Test: Given an array of ints, return True if the sequence.. 1, 3, 4 .. appears in the array somewhere.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Given an array of int's, return True if the sequence.. 1, 3, 4 .. appears in
# the array somewhere.
# O(len(haystack)) || Ω(len(needle))
def appears_in(haystack: list, needle: list) -> bool:
""" Return True if `needle` appears in `haystack`.
#!/usr/bin/env bash
# ~/.macos —
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
rwanyoike /
Created May 28, 2017
Download and parse Unihan and CEDICT files into memory (use BasePackage.rows)
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from gzip import GzipFile
from zipfile import ZipFile
import hashlib
import os
import re
import shutil
rwanyoike / cloudSettings
Last active Sep 4, 2018
Visual Studio Code Sync Settings Gist
View cloudSettings