Skip to content

Instantly share code, notes, and snippets.

Marko mmrko

Block or report user

Report or block mmrko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mmrko /
Last active Jul 26, 2019 — forked from a7madgamal/
Dark Mode for Slack (macOS)
#!/usr/bin/env bash
# Homebaked Slack Dark Mode. After executing this script, hit refresh (⌘ + R) or restart Slack for changes to take effect.
# Adopted from
curl -o "$THEME_FILEPATH" ""
mmrko /
Last active Aug 19, 2019
Prune stale Docker containers, images & volumes (Bash) (versions < 1.13.0)
#!/usr/bin/env bash
stale_images=`docker images --no-trunc --quiet --filter "dangling=true"`
stale_containers=`docker ps --no-trunc --quiet --filter "status=exited"`
stale_volumes=`docker volume ls --quiet --filter "dangling=true"`
stale_images_count=`echo "$stale_images" | sed '/^\s*$/d' | wc -l | xargs`
stale_containers_count=`echo "$stale_containers" | sed '/^\s*$/d' | wc -l | xargs`
stale_volumes_count=`echo "$stale_volumes" | sed '/^\s*$/d' | wc -l | xargs`
echo "Removing stale containers..."
mmrko /
Last active Nov 12, 2019
List only local branches when autocompleting git checkout (Zsh)
git config --global alias.checkoutr checkout
$EDITOR /usr/local/share/zsh/site-functions/git-completion.bash

...and then modify the file as follows...

-__gitcomp_nl "$(__git_refs '' $track)"
+if [ "$command" = "checkoutr" ]; then
+    __gitcomp_nl "$(__git_refs '' $track)"
mmrko /
Last active Aug 7, 2019 — forked from lalyos/
Script to (selectively) save/load multiple Docker images
#!/usr/bin/env bash
# Script to (selectively) save/load multiple Docker images to/from a directory.
# Run ./ for help.
set -e
mmrko /
Last active Jun 24, 2019
git add files ignoring whitespace
# props:
git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero
mmrko / ampersand-mock-sync.js
Last active Aug 10, 2016
Mock AmpersandJS sync for tests (Mocha & Sinon)
View ampersand-mock-sync.js
import BaseModel from 'ampersand-model'
import BaseCollection from 'ampersand-collection'
import sync from 'ampersand-sync'
const xhrImplementation = xhrOptions => {
xhrOptions.success &&, {})
return {}
BaseModel.prototype.sync = BaseCollection.prototype.sync = (method, model, options = {}) => {
mmrko / mocha-react-css-modules.js
Last active Dec 28, 2018
Mocha & React & CSS Modules with Sass
View mocha-react-css-modules.js
// setup.js
import hook from 'css-modules-require-hook'
import sass from 'node-sass'
extensions: [ '.scss' ],
preprocessCss: data => sass.renderSync({ data }).css
git log -L 15,23:filename.txt # evolution of lines 15-23 in filename.txt
You can’t perform that action at this time.