First install clojure
so the clj
command will be available.
brew install clojure
Clone and move core.cljs
to the right directory:
git clone https://gist.github.com/a6427534ea76cd4e9222a76eb398b289.git inc
cd inc
; run `bb backup` to backup database | |
; run `bb restore` to restore latest backup | |
{:min-bb-version "0.4.0", | |
:tasks {; CONSTANTS | |
db-name "dev_blog", | |
backup-dir "backups", | |
now (str (java.time.LocalDateTime/now)), | |
; TASKS | |
create-backup-dir {:depends [backup-dir], :task (babashka.fs/create-dirs backup-dir)}, |
# Inspired by https://gist.github.com/JeffPaine/3083347 | |
# Access full state names using us_states.keys() | |
# Access all state abbreviations using us_states.values() | |
us_states = { | |
'Alabama': 'AL', | |
'Alaska': 'AK', | |
'Arizona': 'AZ', | |
'Arkansas': 'AR', | |
'California': 'CA', | |
'Colorado': 'CO', |
# update brew | |
brew update | |
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core | |
# fork https://github.com/Homebrew/homebrew-core | |
git fetch --all | |
git checkout master | |
git pull | |
git push <FORK> |
#!/usr/bin/env bash | |
echo "Installing Missing Packages" | |
sudo apt update && sudo apt install -y simplestreams apache2 apt-mirror git docker.io python3-pip unzip | |
sudo pip3 install pyyaml | |
sudo pip3 install pyaml | |
sudo snap install kubectl --classic | |
sudo apt-get install juju -y | |
echo "Writing Config Files" |
from typing import Optional | |
import attr | |
from sqlalchemy import ( | |
Table, | |
MetaData, | |
Column, | |
Unicode, | |
Integer, | |
create_engine, | |
ForeignKey, |
#files .file .data pre, | |
#files .file .line-data, | |
#files .file .line-number, | |
code, | |
pre, | |
.blob-code, | |
.blob-code-inner, | |
#readme div.plain pre { | |
font-family: 'Ubuntu Mono', monospace !important; | |
font-variant-ligatures: contextual !important; |
First install clojure
so the clj
command will be available.
brew install clojure
Clone and move core.cljs
to the right directory:
git clone https://gist.github.com/a6427534ea76cd4e9222a76eb398b289.git inc
cd inc
import logging.config | |
import os | |
from django.utils.log import DEFAULT_LOGGING | |
# Disable Django's logging setup | |
LOGGING_CONFIG = None | |
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper() | |
logging.config.dictConfig({ |
def thread_first(value, *forms): | |
''' | |
Returns the given value threaded through the given collection of forms as the first argument. | |
A form is a function or a tuple containing a function as its first element and a list of arguments. | |
The return value of the previously called function will be threaded in as the first argument to the next function. | |
Use this to flatten nested function calls. | |
Example: | |
>>> def add(a, b): |