| Keys | Action | Description |
|---|---|---|
| Cmd-Shift-A | Search action by name | search for any command/menu items |
| Alt-F1 | Select target | Open current file in project tree, finder, etc |
| Keys | Action | Description |
|---|---|---|
| Cmd-O | Class search | classes, traits, objects |
| {-# LANGUAGE OverloadedStrings #-} | |
| import Control.Monad | |
| import Data.Aeson | |
| import Data.Aeson.Types | |
| import qualified Data.ByteString.Lazy as B (readFile) | |
| import Data.Time | |
| data CrosswordType = Quick | Cryptic | |
| deriving Show |
| #!/bin/bash | |
| machine=$1 | |
| [ -z "$machine" ] && machine="default" | |
| docker-machine start $machine | |
| eval "$(docker-machine env $machine)" | |
| echo "VM $machine running: $DOCKER_HOST" |
| function head(xs) { | |
| return xs[0]; | |
| } | |
| function last(xs) { | |
| return xs[xs.length - 1]; | |
| } | |
| function init(xs) { | |
| return xs.slice(0, xs.length - 1); |
| ;; 559e3224324a2b6e66000046 | |
| (defn cart [n] | |
| (let [n (+ n 1)] | |
| (for [x (range 1 n) y (range 1 n)] [x y]))) | |
| (defn xf [f] (map (fn [[x y]] (f x y)))) | |
| (defn sumin [n] | |
| (transduce (xf min) + (cart n))) |
| #!/bin/sh | |
| INSTPREFIX="/opt/cisco/anyconnect" | |
| BINDIR="${INSTPREFIX}/bin" | |
| PLUGINSDIR="${BINDIR}/plugins" | |
| LIBDIR="${INSTPREFIX}/lib" | |
| PROFILESDIR="${INSTPREFIX}/websecurity" | |
| ACMANIFESTDAT="${INSTPREFIX}/VPNManifest.dat" | |
| WEBSECMANIFEST="ACManifestWebSecurity.xml" | |
| UNINSTALLLOG="/tmp/websecurity-uninstall.log" |
| grep -nHC1 "2\.2\.0" npm-shrinkwrap.json \ | |
| | grep -A1 ansi-styles \ | |
| | grep npm-shrinkwrap.json: \ | |
| | cut -d: -f2 \ | |
| | xargs -I"{}" -n1 sed -i {}s/\.0/\.1/ npm-shrinkwrap.json |
| function Queue() { | |
| this.queue = []; | |
| } | |
| /** | |
| * Add an item to the queue | |
| * | |
| * @param {Anything} item item to add | |
| * @return {Number} queue length |
| import scala.util.Random | |
| // http://www.decisionsciencenews.com/2017/06/19/counterintuitive-problem-everyone-room-keeps-giving-dollars-random-others-youll-never-guess-happens-next/ | |
| case class Person(var balance: Int) { | |
| def receive(amount: Int): Unit = { | |
| balance = balance + 1 | |
| } | |
| def give(amount: Int, other: Person): Unit = { |
| # run as root | |
| initctl list | grep -E 'hadoop|hive|spark|yarn' | cut -d' ' -f1 | xargs -L1 restart |