Skip to content

Instantly share code, notes, and snippets.

@desbo
desbo / codewars.clj
Last active December 28, 2015 12:33
codewars
;; 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)))

general

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

opening files

Keys Action Description
Cmd-O Class search classes, traits, objects
@desbo
desbo / samdash.js
Last active January 26, 2016 13:40
samdash
function head(xs) {
return xs[0];
}
function last(xs) {
return xs[xs.length - 1];
}
function init(xs) {
return xs.slice(0, xs.length - 1);
#!/bin/bash
machine=$1
[ -z "$machine" ] && machine="default"
docker-machine start $machine
eval "$(docker-machine env $machine)"
echo "VM $machine running: $DOCKER_HOST"
@desbo
desbo / Puzzle.hs
Created October 13, 2015 15:14
puzzle parser
{-# 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
@desbo
desbo / tc.md
Last active August 27, 2015 16:32
TeamCity artifacts

root-packages

artifact paths

node_modules => node_modules.tar.gz
static/src/jspm_packages => jspm_packages.tar.gz
facia-tool/public/node_modules => facia_node_modules.tar.gz
facia-tool/public/jspm_packages => facia_jspm_packages.tar.gz

root-v2

@desbo
desbo / nat.css
Last active August 29, 2015 14:27
<style type="text/css">
.blog-content h2 {
font-size: 120%;
font-weight: bold;
margin: .5em 0;
}
.blog-content ul {
margin: 1em 5em;
}
@desbo
desbo / nat.html
Last active August 29, 2015 14:27
nat.html
<h1>Page title</h1>
<p>Intro paragraph.</p>
<h2>Sub-heading</h2>
<ul>
<li>First list item!</li>
<li>Second list item!</li>
</ul>
<h2>Another sub-heading</h2>
@desbo
desbo / grid.hs
Created August 6, 2015 10:22
grid
data Grid a = Grid [[a]]
deriving Show
instance Functor Grid where
fmap f (Grid xs) = Grid (map (\ys -> map (\y -> f y) ys) xs)
@desbo
desbo / ff.sh
Created August 4, 2015 15:19
fontforge svg ripper
fontforge -lang=ff -c 'Open($1); SelectWorthOutputting(); foreach Export("svg"); endloop;' font.ttf