Skip to content

Instantly share code, notes, and snippets.

View usametov's full-sized avatar

Ulan Sametov usametov

  • Asta Nova Enterprise Solutions
View GitHub Profile
@usametov
usametov / get-pubmed.clj
Last active July 7, 2022 11:16 — forked from borkdude/scrape_tables.clj
get list of pubmed baseline files
(ns scrape
(:require [babashka.pods :as pods]
[clojure.walk :as walk]))
(pods/load-pod 'retrogradeorbit/bootleg "0.1.9")
(require '[babashka.curl :as curl])
(def pubmed-html (:body (curl/get "https://ftp.ncbi.nlm.nih.gov/pubmed/baseline/")))
@usametov
usametov / calculate-total-expenses.clj
Created June 23, 2022 06:08
babashka script to calculate total expenses
(require '[babashka.fs :as fs])
(require '[clojure.string :as s])
(require '[clojure.edn :as edn])
(require '[clojure.tools.cli :refer [parse-opts]])
(require '[clojure.pprint :as pp])
(def cli-options
[["-i" "--input-file FILE" "total expenses" :default "medical.txt"]
["-h" "--help" "each line in the input file should contain 'CAD' string, e.g. 'child-care-1500CAD.jpg' "]
["-v" nil "Verbosity level"
@usametov
usametov / save_snips.py
Last active April 8, 2022 10:54 — forked from knmkr/search_snpedia.py
Example for calling SNPedia API from python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mwclient
from mwclient import Site
def save_snips(agent, site, path):
"""
http://snpedia.com/index.php/Bulk
https://mwclient.readthedocs.io/en/latest/user/page-ops.html
gets all snips from snpedia
@usametov
usametov / README.md
Created February 9, 2022 11:03 — forked from minhajuddin/README.md
Script to retrieve content from google cache
(require '[babashka.fs :as fs])
;;perform bulk delete operation for a list of files provided in done.txt
(->> (line-seq (io/reader "./done.txt"))
(filter (complement clojure.string/blank?))
(doall (map #(fs/delete-if-exists (str "./test-bb/" %)))))
@usametov
usametov / bash_strict_mode.md
Created August 15, 2021 06:25 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@usametov
usametov / clojurex-talks.org
Created July 9, 2021 00:35 — forked from practicalli-johnny/clojurex-talks.org
List of video presentations from the London Clojurians community
@usametov
usametov / init.vim
Last active July 9, 2021 00:33 — forked from practicalli-johnny/init.vim
Practicalli -- Neovim configuration for Clojure development
" Set mapleader for general commands (not set by default - not sure if this is needed)
" let maplocalleader = "\<Space>"
" Set maplocalleader for Conjure leader key
let maplocalleader = ","
"Relative line numbers
set relativenumber
" Full color theme support for neovim
@usametov
usametov / repl-driven-development-with-spacemacs.org
Created July 9, 2021 00:32 — forked from practicalli-johnny/repl-driven-development-with-spacemacs.org
Screencast script - REPL driven development with Spacemacs

Introduction

Hello and thank you for watching this Practicalli screencast in which I’ll demonstrate a REPL driven development workflow for Clojure using Spacemacs

Spacemacs is a community configuration for Emacs, which uses the CIDER project as the Clojure development environment.

This workflow uses the Clojure CLI tools to run the Clojure REPL

Manage REPL session

, m . and , . calva.jackInOrConnect jack-in and connect menu commandPaletteeditor/context

, m c and , ” calva.connect Connect to a Running REPL Server in the Project Ctrl Alt C Ctrl Alt C | |