Skip to content

Instantly share code, notes, and snippets.

View karlkaebnick's full-sized avatar

Karl Kaebnick karlkaebnick

View GitHub Profile
@karlkaebnick
karlkaebnick / web_framework_research.md
Last active January 20, 2017 19:55
Research of potential web frameworks for use in DoIT

Obviously most of the content on detroitmi.gov will be supported by a CMS. However, there will still be instances where we need to use a web framework to support functionality that the CMS cannot achieve. Because of this I have done some research into what frameworks would be suitable for our purposes. (Note that this is not intended to cover all commonly-used web frameworks - I have intentionally ignored some [web frameworks built in Java or C/C++, for instance] because they tend to present long development cycles that I do not feel are adequate for our purposes. Also, I am leaning strongly towards frameworks that are frequently used / well supported as well as written in a programming language that is itself frequently used, with the intention that it will be easier, when needed, for other developers to work with the frameworks.)

Some of the criteria I have for web frameworks include the following:

  • should be highly productive (i.e., able to let developers achieve high-quality results in minimal time)
@karlkaebnick
karlkaebnick / django_installation_notes.md
Last active March 10, 2017 20:21
Overview of software needed for django
@karlkaebnick
karlkaebnick / detroitmi.gov_drupal_architecture.md
Last active December 8, 2017 22:11
Architecture for city of Detroit's drupal website

Overview:

Our aim is to build a highly-structured database. Doing so will involve a lot more work initially (in comparison with a purely aesthetic redesign) but will make changing the website easier and more fool-proof. This is also in keeping with Drupal website best practices.

Taxonomies:

  • Departments
    • e.g., 'health', 'ddot', 'ocfo', 'dpw'
    • May not always technically be departments - e.g., they may be agencies or authorities.
    • Includes offices / agencies within departments (e.g., 'web team', 'iet', 'office of civil rights')
    • Departments and sub-departments need to be associated with certain pieces of information, e.g.:
  • department contacts
@karlkaebnick
karlkaebnick / drupal_acquia_task_list.md
Last active January 10, 2018 15:31
Drupal / Acquia Task List
  1. Find resolution to issue with acquia not allowing multiple active SSL certs in a single environment - See https://docs.acquia.com/articles/multiple-ssl-certificates-single-balancer - See the Acquia Tam ticket - 2 options: use a SAN cert or a wildcard cert: - SAN requires us to have at most 5 secure websites (which, if we have edge protect and all of our website are secure, meaning we max out at 5 production websites, period) ~~- wildcard cert requires all our production, secure websites to have the same domain name (which is problematic)~~~~
  2. Get rhythm theme working in drupal 8.4 - It currently only supports up to version 8.2 - see ticket
  3. Get varbase installed
@karlkaebnick
karlkaebnick / detroitmi_content_instructions.md
Last active February 12, 2018 17:50
How to add content to the drupal city of Detroit website
  1. Login to the site as an editor: http://detroitmi.theneighborhoods.org/user/login

  2. Navigate to the taxonomy you are going to add content to:

  • Click on Structure -> Taxonomy -> Departments (or "Government" or "Initiatives")
  • Check if the term already exists (If the terms are out of order you can click "Reset to alphabetical" at the bottom of the page to sort them alphabetically). If so, click on the term, and choose "edit". Otherwise, choose "Add Term".
  1. Add the following values:
  • Title
  • Abbreviation (if there is an abbreviation for the department that is typically used)
  • Description
  • in drupal, rich text editors (like the one we use for the description field) you can copy / paste content from other websites (e.g., from the DNN version of detroitmi.gov) or from documents like word, pdf, etc., which actually works pretty well
@karlkaebnick
karlkaebnick / drupal_git_chores.md
Last active March 9, 2019 21:04
How to create a new master branch for a drupal instance
  • verify the new branch has been tested in stage
  • make a backup of current master branch:
    • production drupal instance should be pointing at existing master branch right now
    • create a backup of current master and point production drupal instance to it:
      • checkout the master branch:
        git checkout master
      • make sure you have latest changes for master branch:
        git pull
      • create a backup of the current master branch:
        git checkout -b master_backup_<yyymmdd>
      • push this backup branch to the remote repo:
        git push origin master_backup_<yyymmdd>
    • now switch production drupal instance to the backup master branch you just created
  • now create the new master branch:
@karlkaebnick
karlkaebnick / edit_automated_web_pages.md
Last active July 18, 2019 20:08
How to add, update or remove data from automated web pages
  1. If you have a report to add or replace, then let's take care of that first:
    • navigate to the web page where the report is supposed to be added or replaced (e.g., https://detroitmi.gov/departments/office-chief-financial-officer/financial-reports)
    • copy a link to an existing report to figure out where the new report or replacement report is supposed to go - e.g., if the link to a report that is already available on the page is https://detroitmi.gov/sites/detroitmi.localhost/files/migrated_docs/financial-reports/CityofDetroitOCFOMonthlyFinancialReportMay19FinalCC.pdf, then that indicates your new or replacement report should be uploaded to /var/www/html/detroitmi/docroot/sites/detroitmi.localhost/files/migrated_docs/financial-reports
    • sftp to the web server, e.g., sftp detroitmi.prod@web-35153.prod.hosting.acquia.com
    • navigate to the destination foldeer, e.g., cd /var/www/html/detroitmi/docroot/sites/detroitmi.localhost/files/migrated_docs/financial-reports
  • upload the file, e
@karlkaebnick
karlkaebnick / add_acquia_domain.md
Last active March 8, 2019 20:39
How to add a new domain pointing at an acquia instance
  • Have acquia add the new site to our cloudflare account
    • The new site should have a "partial" DNS configuration
    • Generally this involves adding a TXT record to our DNS account to prove that we "own" the domain.
      • Note: to check if the TXT record has been added:
        host -t TXT <domain>
  • Once the new cloudflare site is added, figure out the correct IP that the domain should be pointed at in order to direct traffic for this domain to cloudflare:
    • Flush your local DNS cache:
      ipconfig /FLUSHDNS
    • Find the correct ip to point the domain at:
      dig .cdn.cloudflare.net
@karlkaebnick
karlkaebnick / how_to_machine_translate.md
Last active July 19, 2019 21:58
How to run the machine translation script
  • Install python 3.6 on an environment with a bash terminal (e.g., linux, macos, or windows with cygwin or git bash installed)
    • (python 3.5 or python 3.7 should be ok if that is what you have installed currently)
  • clone the repo 'website_scripts' - https://github.com/CityOfDetroit/website_scripts
  • set up your environment dependencies in website_scripts:
    • in bash, navigate to wherever you cloned website_scripts (e.g., /home/kaebnickk/sites/website_scripts/) and run the following:
    • create a virtualenv in website_scripts:
      python3 -m venv .
    • activate the virtualenv you just created:
      source bin/activate (or source scripts/activate if you are in windows)
    • now install your dependencies:
      pip install -r requirements.txt
  • create a file named google_translate_key.json in the root of the repo (get the data to put in this file from edgar or karl - it contains keys and credentials and stuff that cannot go in the repo)
  • put your english content to be translated into a text
@karlkaebnick
karlkaebnick / apple_app_analytics.md
Created August 29, 2019 21:34
apple app analytics
  • can be graphed over time or aggregated over a period of time:
    • number of installations
    • number of deletions
    • number of users who were active in last N days
    • sessions in last N days
    • number of crashes
    • number of 'impressions' (the # of times your app showed up in the app store)
  • other:
  • where did the installer come from? (e.g., app store search? web referrer? app referrer?