This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-clipboard [] | |
(.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))) | |
(defn slurp-clipboard [] | |
(try | |
(.getTransferData (.getContents (get-clipboard) nil) (java.awt.datatransfer.DataFlavor/stringFlavor)) | |
(catch java.lang.NullPointerException e nil))) | |
(defn spit-clipboard [text] | |
(.setContents (get-clipboard) (java.awt.datatransfer.StringSelection. text) nil)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h1>Our Navigation</h1> | |
<p>I'm writing an example xhtml document to get converted into markdown!</p> | |
<h2>Examples</h2> | |
<h3>Text formatting</h3> | |
<p>Sometimes with longer <em>paragraphs</em><br/>we just want a new line <strong>immediately</strong>.</p> | |
<div>Divs are block elements too, and people don't always put their text in p tags.</div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir expressWithLess && cd expressWithLess | |
$ express --css less-middleware && npm install | |
$ mv public/stylesheets/ public/styles | |
$ nano public/styles/style.less | |
@color: #00B7FF; | |
body { padding: 200px; font: 18px "Lucida Grande", Helvetica, Arial, sans-serif; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reduce = Array.reduce; | |
// Call function `f` with value `x`. | |
const callWith = (x, f) => f(x); | |
// Pipe value `x` through many single-argument functions in succession. | |
// This is kind of like a Unix pipe. The value of the previous function is | |
// passed to the next function, etc. Note that functions are called | |
// from left-to-right, with left being first. | |
export const pipe = (x, ...f) => reduce(f, callWith, x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=High-performance, schema-free document-oriented database | |
Documentation=man:mongod(1) | |
After=network.target | |
[Service] | |
Type=forking | |
User=mongodb | |
Group=mongodb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# [email protected] | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |