Skip to content

Instantly share code, notes, and snippets.

View Stiivi's full-sized avatar

Stefan Urbanek Stiivi

View GitHub Profile
@Stiivi
Stiivi / filestosql.zsh
Created October 9, 2019 10:54
Create/update a SQLite3 database file with all files in a given path.
#!/bin/zsh
#
# Create/update a SQLite3 database file with all files in a given path.
#
# Usage:
#
# filestosql SQLITE_DATABASE [PATH]
#
DB_FILE=${1}
DEF TAG polymerase
DEF SLOT complement
# Template site
DEF SLOT t_site
# Complementary site
DEF SLOT c_site
DEF TAG nucleotide
DEF TAG promoter
DEF TAG free
DEF TAG taken
@Stiivi
Stiivi / cubes2.0-goals.md
Last active August 5, 2017 00:51
Cubes 2.0 Goals

Cubes 2.0

Hi there. After almost two years of none or very sparse activity due to life and career situation, I’m committing myself back to the Cubes project. It will take some time to ramp-up, but we will eventually get there. I apologize for not meeting expectations lately and for letting the framework, mailing list and discussions go stale.

I got quite a lot of useful feedback and recommendations from users and people in the domain and that revived my motivation to spend more of my spare time to make Cubes better and modern OLAP toolkit.

Now, let’s move forward. To do any improvements or changes, Cubes needs quite a lot of housekeeping. The whole 2.0 release addresses that. Only when we have consistent, well-defined interface, when we have goals and equally importantly non-goals set, we can start growing Cubes again.

Links:

@Stiivi
Stiivi / sqlalchemy.py
Last active May 4, 2022 14:45
Cubes SQLAlchemy imports
"""Aliases for SQL/SQLAlchemy objects that are assured to be correctly
type-checked."""
import sqlalchemy
# Engine
# ======
Engine = sqlalchemy.engine.base.Engine
Connection = sqlalchemy.engine.base.Connection
@Stiivi
Stiivi / interfaces.pyi
Created March 19, 2017 21:38
interfaces.pyi
from typing import Any, Iterator, List, Mapping, Optional
# Note: The value type `Any` should be a DB API 2 value type once defined
# TODO: See #1037
class RowProxy(Mapping[str, Any]): ...
class ResultProxy(Iterator[RowProxy]):
def keys(self) -> List[str]: ...
def close(self) -> None: ...
@Stiivi
Stiivi / cubes-non-intuitive-data-types.py
Last active March 19, 2017 20:31
Cubes non-intuitive data types
# The following data types were discovered in Cubes while type-annotating the source code.
# Sometimes it might seemed a good idea to permit people pass whatever they want, however opens
# way too many possibilities for unchecked errors.
#
# Type that can be passed as drilldown to the browser's `aggregate()` function:
#
_DrilldownType = Union[
Drilldown,
Dict[str, Union[Dimension, str]],
@Stiivi
Stiivi / thing.py
Last active February 20, 2017 23:52
Entigen example
from typing import Any, List, cast, Optional
class Thing:
# Name
name: str
"""Name of a thing"""
# Type
type: str
"""Type of a thing"""
### Keybase proof
I hereby claim:
* I am stiivi on github.
* I am stiivi (https://keybase.io/stiivi) on keybase.
* I have a public key ASBLM9Aydkaxn4ImB5736izffGiLrFrR5p16_2j4XSsbvQo
To claim this, I am signing this object:
@Stiivi
Stiivi / snowflake.vim
Created July 21, 2016 18:03
Snowflake
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case ignore
syn keyword cubesStatement dimension fact hierarchy repr nextgroup=cubesModelObject skipwhite
"" Experimental
# -----------------------
DIMENSION city REFERENCES country
DIMENSION country REFERENCES region, market
DIMENSION region
DIMENSION market
DIMENSION agent REFERENCES market
DIMENSION company
REFERENCES
agent,