Skip to content

Instantly share code, notes, and snippets.

@alxdb
alxdb / truncate_all_tables.clj
Created July 26, 2019 09:53
clojure code snippet to truncate all tables in a cassandra database
(ns truncate-all-tables
(:require [qbits.alia :as alia]))
(defonce cluster (alia/cluster {:contact-points ["localhost"]}))
(defonce session (alia/connect cluster))
(def table-names-query (alia/prepare session "select * from system_schema.tables where keyspace_name=?"))
(defn get-all-table-names
[keyspace]
@alxdb
alxdb / api response
Created May 14, 2019 13:24
response to http://localhost:8080/api/orgs/f7c3d590-4b33-11e5-8978-fa2a23995eb5/timelines/bar
[ "prpr.promise/unknown-error", {
"error" : "#error {\n :cause Input to api-method-handler__232421 does not match schema: \n\n\t \u001B[0;33m [nil nil (named [nil (named {:auth-user-id (not (instance? java.util.UUID nil))} :value)] arg2)] \u001B[0m \n\n\n :data {:type :schema.core/error, :schema [#schema.core.One{:schema Any, :optional? false, :name arg0} #schema.core.One{:schema Any, :optional? false, :name opts} #schema.core.One{:schema [#schema.core.One{:schema (eq :er-model.newsfeed.api/org-timeline-GET), :optional? false, :name :tag} #schema.core.One{:schema {:org-id java.util.UUID, :timeline-id-or-tag java.lang.String, :auth-user-id java.util.UUID}, :optional? false, :name :value}], :optional? false, :name arg2}], :value [{:org-user-auth-token-handler #er_model.orgs.auth_tokens.db_tokens.DbOrgUserAuthTokenHandler{:cassandra #er_cassandra.model.alia.model_session.AliaModelSession{:alia-session #er_cassandra.session.alia.AliaSession{:keyspace yapdev_2_4_0, :alia-session #object[com.datastax.driver.core

Keybase proof

I hereby claim:

  • I am alxdb on github.
  • I am alxdb (https://keybase.io/alxdb) on keybase.
  • I have a public key ASCrrlOsARxkZwzJ-odJo6et1JkuXBUlusSbZ_k_d6eYYgo

To claim this, I am signing this object:

# bash prompt
_alxdb_prompt_cmd () {
local res="\[$(tput sgr0)\]"
local n_jobs=$([ $(jobs -p | wc -l | sed 's/^ *//') != 0 ] && printf "[\j] ")
export PS1="\w${res}\n${n_jobs}\$ "
}
export PROMPT_COMMAND=_alxdb_prompt_cmd
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@alxdb
alxdb / .bashrc
Created May 7, 2019 09:16
Mac basic
# Sources
## bash completion (installed by Homebrew)
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
## additional bash files
for f in $(find ~/.bash.d -name "*.bash"); do source $f; done
# Enviroment
## bsd ls colors
export CLICOLOR="true"