Content of this gist
was move to repo https://github.com/rabbitonweb/emacs_ensime_guide (for you to use and fork :) )
This file contains hidden or 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
import _root_.bintray.Bintray | |
enablePlugins(JavaAppPackaging, JDebPackaging) | |
name := "my-project" | |
maintainer := "My name <[email protected]>" | |
packageSummary := "Super package" |
A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)
I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.
A functor is something that supports map
.
This file contains hidden or 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
class ChatRoom(roomId: Int, actorSystem: ActorSystem) { | |
private[this] val chatRoomActor = actorSystem.actorOf(Props(classOf[ChatRoomActor], roomId)) | |
def websocketFlow(user: String): Flow[Message, Message, _] = ??? | |
def sendMessage(message: ChatMessage): Unit = chatRoomActor ! message | |
} |
- Log into the container and create an empty directory, this will be the mount point
- Log out and stop the container.
- Open to your container's config file
- For regular LXC containers:
/var/lib/lxc/mycontainer/config
- For unprivileged LXC containers:
$HOME/.local/share/lxc/mycontainer/config
- For regular LXC containers:
- Add a new line above the
lxc.mount
directive, that follows the format below. Substitute proper paths as necessary:lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
- Both of these paths are relative to the host machine.
This file contains hidden or 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
# Set variables in .bashrc file | |
# don't forget to change your path correctly! | |
export GOPATH=$HOME/golang | |
export GOROOT=/usr/local/opt/go/libexec | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin |
This file contains hidden or 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
// Тайпкласс Animal (для полноты картины добавил метод hello, иначе был бы совсем тривиальный пример) | |
// Animal полностью абстрагирован от низлежашего типа A | |
trait Animal[A] { | |
def word: String | |
def talk() { println(word) } | |
def hello(a: A): String | |
} | |
// Обертка над тайпклассом Animal, чтобы можно было писать cat.hello, а не animal.hello(cat) | |
// AnimalOps полностью дублирует методы, определённые в Animal, но также может содержать еще и дополнительные методы. |
The basic structure of a React+Flux application (see other examples)
- /src/actions/AppActions.js - Action creators (Flux)
- /src/components/Application.js - The top-level React component
- /src/constants/ActionTypes.js - Action types (Flux)
- /src/core/Dispatcher.js - Dispatcher (Flux)
- /src/stores/AppStore.js - The main store (Flux)
This file contains hidden or 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
;; .emacs | |
;;; uncomment this line to disable loading of "default.el" at startup | |
;; (setq inhibit-default-init t) | |
;; enable visual feedback on selections | |
(setq transient-mark-mode t) | |
;; default to better frame titles | |
(setq frame-title-format |
This file contains hidden or 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
(defun right-arrow () | |
(interactive) | |
(cond ((looking-back "=") | |
(backward-delete-char 1) (insert "⇒")) | |
((looking-back "-") | |
(backward-delete-char 1) (insert "→")) | |
(t (insert ">")))) | |
(defun left-arrow () | |
(interactive) |