Skip to content

Instantly share code, notes, and snippets.

View dbushenko's full-sized avatar

Dmitry Bushenko dbushenko

  • USA
View GitHub Profile
// mutable i
//
int i = 0;
while (something() > 0) {
i++;
}
// immutable i
//
(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))
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;
let result <- runMaybeT $ do Engine.boost.quick_fetch [Foam Beer_opener Lighter_gun]
send_to Defender.closest.dear
append $ hugs <> kisses
say "Hurrah!"
;; Поиск вперед
(global-set-key (kbd "M-;") 'isearch-forward)
;; Поиск назад
(global-set-key (kbd "M-:") 'isearch-backward)
;; В режиме поиска добавляем несколько клавиш:
;; M-; -- повторить поиск вперед
;; M-: -- повторить поиск назад
;; M-v -- вставить скопированный текст
(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\\."])
import qualified Data.Vault.Lazy as Vault
...
main :: IO ()
main = do
...
session <- Vault.newKey
let m = Vault.lookup session "key"
...
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Db
import Views
import Data.Default (def)
import Data.String (fromString)
import Web.Scotty
{-# 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
{-# 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)