Skip to content

Instantly share code, notes, and snippets.

@honza
honza / file.md
Last active September 11, 2018 17:33
Using packaged dependencies during development

Using packaged dependencies during development

This tiny guide shows you how you can use TripleO UI dependencies packaged in openstack-tripleo-ui-deps during development.

Why? Many of our dependencies in package.json aren't pinned down to a specific version. This can cause problems when a small change is introduced in one or more of our dependencies. You can get the dependencies from the upstream RPM to see what will be included in production, and how you change will be affected.

@honza
honza / toggle.sh
Created May 17, 2016 12:51
Toggle between single and dual screens
#!/usr/bin/env bash
xrandr=$(xrandr)
count=$(echo "$xrandr" | grep " connected" | wc -l)
if [[ $count -eq 2 ]];
then
# Dual configuration
secondary=$(echo "$xrandr" | grep " connected" | grep -v "primary" | cut -d ' ' -f 1)
xrandr --output eDP1 --primary --output $secondary --auto --left-of eDP1
@honza
honza / Danielle.md
Last active November 17, 2015 17:11

In the original video, a random lady on the street is interviewed by media. She appears to be in her 70s, and she is standing in front of a memorial for the victims of the recent terrorist attacks in Paris.

She said:

C'est très important d’apporter des fleurs à nos morts, c'est très important de lire plusieurs fois le livre d'Hemingway Paris est une fête. Nous sommes une civilisation très ancienne et nous porterons au plus haut nos valeurs. Nous fraterniserons avec les 5 millions de musulmans qui exercent leur

Verifying that +honzapokorny is my blockchain ID. https://onename.com/honzapokorny
@honza
honza / clojure.md
Last active September 24, 2015 17:32
Clojure and memory usage in development

Developing in Clojure seems to require tons of RAM. I'm currently working on a small HTTP service: 200 LOC, minimal dependencies. I'm using lein ring server-headless to run a development server, and I'm using Emacs and the CIDER repl. This spins up 4 java processes on my machine, 2 for the server and 2 for CIDER.

That's almost 3GB of RAM. If you're also running a VM in virtualbox or VMware, your computer is gonna have a bad time.

VMware Fusion is using only 200MB of RAM. No idea how that's possible.

// Given
var content = {
id: 1,
name: 'Honza'
};
function renderTemplate(content) {
return 'Hello, ' + content.name;
}
dactyl/pentadactyl/../common/make_jar.sh: line 47: unexpected EOF while looking for matching `''
make: *** [chrome/] Error 2
@honza
honza / angular.cljs
Created August 26, 2014 07:54
Quick wisp macro example - Angular controller
(def app {})
(defmacro fnj [args & body]
(if (empty? args)
`(fn [] ~@body)
`[~@(map name args) (fn ~args ~@body)]))
(defmacro def-controller [module n args & body]
`(.controller ~module ~(name n) (fnj ~args ~@body)))
@honza
honza / pure.clj
Created May 7, 2014 17:06
Impure function detectio
;; If you name your impure functions with a name ending in "!",
;; you can use this handy macro to check if a form uses any impure functions.
(declare find-impure)
(defn ends-in-bang? [s]
(= \! (last (str s))))
(defn impure? [e]
(cond