Create topcis.json
{
"version": 1,
"topics": [
{ "topic": "my-sample-topic"
| SPC s c remove highlight | |
| **** Files manipulations key bindings | |
| Files manipulation commands (start with ~f~): | |
| | Key Binding | Description | | |
| |-------------+----------------------------------------------------------------| | |
| | ~SPC f c~ | copy current file to a different location | | |
| | ~SPC f C d~ | convert file from unix to dos encoding | | |
| | ~SPC f C u~ | convert file from dos to unix encoding | |
| source $stdenv/setup | |
| PATH=$dpkg/bin:$PATH | |
| dpkg -x $src unpacked | |
| cp -r unpacked/* $out/ |
| // Like interruptWhen / interrupt but allows resumption of the source stream. | |
| def pauseWhen[F[_]: Async, A](controlSignal: Signal[F, Boolean]): Pipe[F, A, A] = | |
| pause(controlSignal.discrete) | |
| def pause[F[_]: Async, A](control: Stream[F, Boolean]): Pipe[F, A, A] = { | |
| def unpaused( | |
| controlFuture: ScopedFuture[F, Pull[F, Nothing, (NonEmptyChunk[Boolean], Handle[F, Boolean])]], | |
| srcFuture: ScopedFuture[F, Pull[F, Nothing, (NonEmptyChunk[A], Handle[F, A])]] | |
| ): Pull[F, A, Nothing] = { |
| def switchMap[F[_]: Async, A, B](f: A => Stream[F, B]): Pipe[F, A, B] = { | |
| def go( | |
| outer: ScopedFuture[F, Pull[F, Nothing, (NonEmptyChunk[A], Handle[F, A])]], | |
| inner: ScopedFuture[F, Pull[F, Nothing, (NonEmptyChunk[B], Handle[F, B])]] | |
| ): Pull[F, B, Nothing] = { | |
| (outer race inner).pull.flatMap { | |
| case Left(outer) => | |
| outer.optional.flatMap { | |
| case None => | |
| inner.pull.flatMap(identity).flatMap { case (hd, tl) => Pull.output(hd) >> tl.echo } |
| package fs3 | |
| import cats.Monad | |
| sealed abstract class Free[F[_], R] { | |
| def flatMap[R2](f: R => Free[F, R2]): Free[F, R2] = Free.Bind(this, f) | |
| } | |
| object Free { | |
| case class Pure[F[_], R](r: R) extends Free[F, R] | |
| case class Eval[F[_], R](fr: F[R]) extends Free[F, R] |
| {-# Language ExistentialQuantification #-} | |
| {-# Language GADTs #-} | |
| {-# Language RankNTypes #-} | |
| {-# Language ScopedTypeVariables #-} | |
| import Control.Monad | |
| import Control.Applicative | |
| import Data.List hiding (uncons) | |
| import Data.Time |
| package half | |
| import scala.math.{pow, round, signum} | |
| import scala.util.Random.nextInt | |
| import java.lang.{Float => JFloat} | |
| /** | |
| * Float16 represents 16-bit floating-point values. | |
| * | |
| * This type does not actually support arithmetic directly. The |
Upgrading to Lion or Yosemite and WebStorm 9, I noticed key repeat was
turned off for the IdeaVim plugin h j k l keys.
defaults write -g ApplePressAndHoldEnabled -bool false in a terminal will enable
key repeat for every app. This can alternatively be found in the accessibility
settings in OS X' preferences.
| package tinker.scalazEffect | |
| import java.nio.ByteBuffer | |
| import java.nio.channels.{AsynchronousChannel, AsynchronousFileChannel, CompletionHandler} | |
| import java.nio.charset.{Charset, StandardCharsets} | |
| import java.nio.file.{Path, Paths, StandardOpenOption} | |
| import scalaz.data.Disjunction.{-\/, \/-} | |
| import scalaz.effect.IO.IOTrampoline | |
| import scalaz.effect.IO.IOTrampoline.{IOTDone, IOTMore} |