Skip to content

Instantly share code, notes, and snippets.

@chrismarksus
chrismarksus / build-json-from-git-log.sh
Created February 7, 2019 20:27
build json from git log shell commands
{name:'$R',hash:'%H',commitrelative:'%cr',commitdate:'%cd',subject:'%s'}
{name:"$R",hash:"%H",commitrelative:"%cr",commitdate:"%cd",subject:"%f"}
{$R %H %cr %cd %s}
$R %H %cr %cd %s
echo "{ results: [" && for R in `git branch -r`; do git log -100 ${R} --merges --since='6 months ago' --grep="Merge branch 'master' into" --pretty='{name:"$R",hash:"%H",commitrelative:"%cr",commitdate:"%cd",subject:"%f"},'; done | sed '$s/\,//g'&& echo "]}"
echo "{ results: [" && for R in `git branch -r`; do git log -100 ${R} --merges --since='6 months ago' --grep="Merge branch 'master' into" --pretty='{%n "remote": "$R",%n "commit": "%H",%n "author": "%an <%ae>",%n "date": "%ad",%n "message": "%f"%n},'; done | sed '$s/\,//g'&& echo "]}"
@chrismarksus
chrismarksus / vim_commands.md
Created February 7, 2019 20:09
vim command cheat sheet

Cursor movement

* h - move left
* j - move down
* k - move up
* l - move right
* w - jump by start of words (punctuation considered words)
* W - jump by words (spaces separate words)
* e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
@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
@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 / 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 / _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 / _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 / 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 / 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 / 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