This file contains hidden or 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
# /etc/nginx/conf.d/conda.conf | |
proxy_cache_path /var/cache/nginx/conda levels=2:2 keys_zone=conda:100m inactive=14d max_size=10g; | |
upstream conda.anaconda.org { | |
server 104.17.92.24:443; | |
server 104.17.93.24:443; | |
} | |
server { | |
listen 80; |
This file contains hidden or 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
#!/bin/bash | |
## Entrypoint for docker RUN directives as well as ENTRYPOINT with conda env | |
## Enable by adding: | |
## COPY entry.sh ./ | |
## SHELL ["/entry.sh", "/bin/bash", "-c"] | |
## | |
## Optionally, set the following env to select a conda env to run in | |
## ENV CONDA_DEFAULT_ENV=foo | |
## You may also want to add something like | |
## RUN conda init bash && echo 'conda activate "${CONDA_TARGET_ENV:-base}"' >> ~/.bashrc |
This file contains hidden or 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
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite | |
-- Enable to delete logs by cascading delete | |
PRAGMA foreign_keys = ON; | |
WITH n_build_ids_per_repo as ( | |
SELECT build_id | |
FROM ( | |
SELECT | |
build_id, | |
build_repo_id, |
This file contains hidden or 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
val li=List(1,2,10,20,30) //> li : List[Int] = List(1, 2, 10, 20, 30) | |
def insert[T](li:List[T],x:T)(implicit cmp:Ordering[T])={ | |
val (first,last)=li.partition {cmp.lteq(_, x) } | |
first:::x::last | |
} //> insert: [T](li: List[T], x: T)(implicit cmp: Ordering[T])List[T] | |
insert(li,11) //> res0: List[Int] = List(1, 2, 10, 11, 20, 30) | |
insert(li,10) //> res1: List[Int] = List(1, 2, 10, 10, 20, 30) | |
insert(li,9) //> res2: List[Int] = List(1, 2, 9, 10, 20, 30) |