Embeds SQL syntax highlighting inside Ruby heredocs labeled SQL
. This will also work to embed other syntaxen, e.g., HTML.
(requires https://github.com/exu/pgsql.vim)
syntax include @SQL syntax/pgsql.vim
module Linear.VPTree | |
( fromList | |
, nearest | |
) where | |
import Linear | |
import Data.Word8 | |
import Data.List (partition, sortBy) | |
import Data.Ord (comparing) | |
import Data.Function (on) |
-- | A scan-conversion algorithm for drawing lines on integral coordinate | |
-- systems. Returns the list of coordinates that should be filled to draw | |
-- the line from point to point. | |
line :: (Integral a) => V2 a -> V2 a -> [V2 a] | |
line p p' = fmap near [0..end] where | |
end = case abs (p - p') of V2 dx dy -> max dx dy | |
near i = round <$> lerp (i % end) | |
(fmap fromIntegral p') | |
(fmap fromIntegral p) |
import Monad | |
@doc """ | |
Read and decode a file | |
Returns {:ok, result} or {:error, reason} | |
""" | |
def decode_file(fh) do | |
monad ErrorM do | |
contents <- File.read(fh) |
# A bunny has three offspring each generation. | |
generation = -> (x) { [x,x,x] } | |
# How many bunnies will there be after two generations? | |
["bunny"].flat_map(&generation).flat_map(&generation).length # => 9 |
Embeds SQL syntax highlighting inside Ruby heredocs labeled SQL
. This will also work to embed other syntaxen, e.g., HTML.
(requires https://github.com/exu/pgsql.vim)
syntax include @SQL syntax/pgsql.vim
class people::reinh { | |
# Dev stuff | |
include tmux | |
include ctags | |
include vagrant | |
include iterm2::dev | |
include zsh | |
include java | |
include mysql | |
include redis |
$home = "/Users/${::luser}" | |
$my = "${home}/my" | |
file { $my: ensure => directory } | |
repository { | |
"$my/keyword_search": | |
source => "reinh/keyword_search", | |
require => File[$my]; | |
"$my/coffeequest": |
class Dijkstra extends PathFinder | |
heuristic: -> 0 | |
class AStar extends PathFinder | |
heuristic: (start, finish) -> | |
_.max _.map [start.x - finish.x, start.y - finish.y], Math.abs | |
class DrunkAStar extends PathFinder | |
heuristic: Math.random |
While trade unions may have many of the benefits stated in the article, they also have some negative effects on markets. Many of these are covered (briefly) by Wikipedia in Opposition To Trade Unions, as are the responses to these arguments. I would like to present one further argument:
Having options is valuable. If you are considering buying a business valued at $110,000, which of these two options would you prefer?
class @Engine | |
constructor: (@world, @context) -> | |
{height: height, width: width} = @world.dimensions | |
Backbone.on 'move', (args...) => @move args... | |
@player = @world.player | |
@display = new Display(rows: height, columns: width) | |
actors = [@player, new Random(10,10, @)] | |
@scheduler = new Scheduler(actors) |