Key | Action |
---|---|
cpp | Evaluate the form under the cursor |
K | Look up the symbol under the cursor with (doc) |
[ d | Look up the symbol under the cursor with source |
[ Ctrl+D | Jumps to the definition of a symbol |
gf | "go to file" command, works on namespaces. |
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 math, strformat, times | |
func fib(n: int): int = | |
if n <= 2: | |
return 1 | |
else: | |
return fib(n - 1) + fib(n - 2) | |
when isMainModule: | |
let x = 47 |
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
#!/usr/bin/env stack | |
{- stack | |
script | |
--resolver lts-15.1 | |
--install-ghc | |
--ghc-options -Wall | |
--ghc-options -Werror | |
--package rio | |
--package process | |
-} |
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
main :: IO () | |
main = (do | |
(putStrLn "Starting Server....") | |
(scotty 3000 (do | |
(get "/hello/:name" (do | |
name <- param "name" | |
text ("hello " <> name <> "!"))) | |
(get "/users" | |
(json allUsers)) |
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
hello: | |
ghc -static -optl-static -o hello hello.hs | |
upx --best --ultra-brute hello | |
install: | |
sudo apt install upx haskell-stack | |
stack upgrade --binary-only | |
stack setup |
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
# In your python env, run `make install` to install required packages | |
# and then either `make` for a single test run | |
# or `make watch` for a continuous pipeline that reruns on changes. | |
# | |
# Comments and/or hate mail to o@tman.me | |
.SILENT: test install upgrade watch checks | |
test: checks | |
pytest |
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
from multiprocessing import Pool | |
def pmap(f, collection, size=10): | |
""" | |
Applies `f` in parallel over `collection`. | |
Pool `size` has a sensible default of 10. | |
""" | |
with Pool(size) as p: | |
return p.map(f, collection) |
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
( | |
go | |
lua | |
csv | |
sql | |
typescript | |
crystal | |
ruby | |
(clojure | |
:variables clojure-enable-fancify-symbols t |
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 os | |
import time | |
import datetime | |
from datetime import timedelta | |
from terminaltables import SingleTable | |
from colorclass import Color | |
FIVE_MINS = timedelta(minutes=5) |
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
(comment "repl experiments" | |
(do ; run this block to repeatably run the test | |
(use 'your-ns :reload-all) | |
(require '[eftest.runner :refer [run-tests find-tests]]) | |
(run-tests (find-tests 'your-ns.your-test) | |
{:report eftest.report.pretty/report}))) |