Skip to content

Instantly share code, notes, and snippets.

@chrismarksus
chrismarksus / copy_url_to_static_site.sh
Created November 14, 2017 21:18
Copy a website as a static download
wget -P save/to/directory/ -mpck --user-agent="" -e robots=off --wait 1 -E http://url.to.site:5000
@chrismarksus
chrismarksus / Dockerfile
Created November 14, 2017 21:22
docker for slack-export-viewer
FROM python:3
MAINTAINER Chris Marks
ENV HOST=0.0.0.0
ENV PORT=5000
WORKDIR /app
EXPOSE ${PORT}
@chrismarksus
chrismarksus / git_churn.sh
Created December 8, 2017 13:16
bash scripts to generate commit churn and line counts on files in a git repo
git log --all -M -C --name-only | sort | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' > git_churn_data.csv
@chrismarksus
chrismarksus / windows_10_permissions_hosed.md
Last active May 10, 2018 15:24
If Windows 10 permissions get hosed (break glass)

(https://blog.switchfast.com/solved-windows-10-upgrade-changed-all-documents-to-read-only)

  • Go to “File Explorer” (documents). At the top of File Explorer, there are three menu tabs: home, share, and view. Click view. All the way down to the right, click the options button. Then click “change folder and search options”

  • A new window will open with three tabs: general, view, and search. Click on the view tab. You will see a long checklist – go to the “hidden files and folders” folder and check “show hidden files, folders and drives.”

  • Further down the checklist, you will see “hide protected operating system files (recommended)” – uncheck this. A warning box will pop up – click yes.

  • Click the “OK” button in the opened window and you’ll be back to your file screen. On the side menu, click “this PC” and then click the “local disk” icon. From there, click the “users” folder. In the users folder, find the folder that has your username and right click Scroll down the menu that appears and click “properties.

@chrismarksus
chrismarksus / twitter_feed_js_data.js
Created June 8, 2018 12:52
Twitter feed in a javascript object
const testData = [{
"created_at": "Thu Apr 06 15:24:15 +0000 2017",
"id_str": "850006245121695744",
"text": "1\/ Today we\u2019re sharing our vision for the future of the Twitter API platform!\nhttps:\/\/t.co\/XweGngmxlP",
"user": {
"id": 2244994945,
"name": "Twitter Dev",
"screen_name": "TwitterDev",
"location": "Internet",
"url": "https:\/\/dev.twitter.com\/",
@chrismarksus
chrismarksus / _break-html-up-into-testable-methods.markdown
Last active June 18, 2018 13:40
_Break HTML up into testable methods

_Break HTML up into testable methods

The original version that was used as a reference was the single large method with and if/then/else that tested a variable for one or zero. Then set a variable to a string for html with 3 radio buttons. The index number was used to seed id name and value passed to methods.

ISSUES:

  • 3 large chunks of HTML with repeatative radio buttons that only difference was a checked attribute
@chrismarksus
chrismarksus / _separate-dom-manipulation-methods-from-functional-methods.markdown
Last active June 15, 2018 15:46
_Separate DOM Manipulation methods from Functional methods

_Separate DOM Manipulation methods from Functional methods

This is an example of how you might separate method with side-effects from pure functions. This make the not only the pure function testable but the methods with side-effect are more general purpose and become more of a utility method that is easier to test

A Pen by Chris Marks on CodePen.

License.

@chrismarksus
chrismarksus / Dockerfile
Last active November 20, 2018 17:25
Inkscape Dockerfile
FROM alpine:latest
RUN apk --no-cache add \
inkscape \
ttf-inconsolata \
ttf-liberation \
ttf-linux-libertine \
ttf-opensans \
ttf-ubuntu-font-family && \
adduser -D inkscape
@chrismarksus
chrismarksus / 2019_work_tech_agile_reading_online.md
Last active November 20, 2019 16:01
Articles I have read in 2019

Work/Technology/Agile article:

Books

  • Serious Python: Black-Belt Advice on Deployment, Scalability, Testing, and More
  • Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming
  • Agile Metrics in Action: Measuring and Enhancing the Performance of Agile Teams
  • Sprint: Solve, Test, Five Days
  • Infrastructure as Code: Managing Servers in the Cloud

March

@chrismarksus
chrismarksus / basic_bash.md
Last active February 7, 2019 18:46
Basic Bash commands to learn

Bash command to get you started:

  • ssh [email protected]
  • grep -lrn PATTERN DIRECTORY/PATH
  • export
  • ls -al
  • mkdir
  • rm -rf FILENAME
  • less/more/cat
  • pwd