This file contains 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
// mutable i | |
// | |
int i = 0; | |
while (something() > 0) { | |
i++; | |
} | |
// immutable i | |
// |
This file contains 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 reverse-input-method (input-method) | |
"Build the reverse mapping of single letters from INPUT-METHOD." | |
(interactive | |
(list (read-input-method-name "Use input method (default current): "))) | |
(if (and input-method (symbolp input-method)) | |
(setq input-method (symbol-name input-method))) | |
(let ((current current-input-method) | |
(modifiers '(nil (control) (meta) (control meta)))) | |
(when input-method | |
(activate-input-method input-method)) |
This file contains 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
public Person mainFlow(String arg1, String arg2, int arg3) throws WrongArgs, WrongPerson, WrongResult { | |
verifyArgs(arg1, arg2, arg3); | |
Person p = personRepo.readFromDb( arg3 ); | |
verifyPerson(p); | |
Result result = doSomething(arg1, arg2, p); | |
checkResult( result ); | |
return p; |
This file contains 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
let result <- runMaybeT $ do Engine.boost.quick_fetch [Foam Beer_opener Lighter_gun] | |
send_to Defender.closest.dear | |
append $ hugs <> kisses | |
say "Hurrah!" |
This file contains 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
;; Поиск вперед | |
(global-set-key (kbd "M-;") 'isearch-forward) | |
;; Поиск назад | |
(global-set-key (kbd "M-:") 'isearch-backward) | |
;; В режиме поиска добавляем несколько клавиш: | |
;; M-; -- повторить поиск вперед | |
;; M-: -- повторить поиск назад | |
;; M-v -- вставить скопированный текст |
This file contains 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
(task update-version | |
"Updates version of the software" | |
(start [:shell (str *src-dir* "update-version.sh")]) | |
(stop :kill)) | |
(task run-zookeeper | |
"Runs zookeeper" | |
(depends-on update-version) | |
(start [:shell (str *base-dir* "bin/zookeeper.sh")] | |
[:finish-when :stdout :regexp "\\.started\\."]) |
This file contains 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 qualified Data.Vault.Lazy as Vault | |
... | |
main :: IO () | |
main = do | |
... | |
session <- Vault.newKey | |
let m = Vault.lookup session "key" | |
... |
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Db | |
import Views | |
import Data.Default (def) | |
import Data.String (fromString) | |
import Web.Scotty |
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Web.Scotty | |
import Data.Monoid (mconcat) | |
import Network.Wai.Middleware.Static | |
import Network.Wai.Middleware.RequestLogger (logStdoutDev) | |
import Control.Monad.IO.Class | |
import qualified Data.Text.Lazy as TL |
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Data.Default (def) | |
import Web.Scotty | |
import Data.Monoid (mconcat) | |
import Network.Wai.Middleware.Static | |
import Network.Wai.Middleware.RequestLogger (logStdoutDev) | |
import Network.Wai.Session (withSession, Session) |
NewerOlder