This file contains 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
""" | |
This module contains methods for generation and validation invitation tokens. | |
You should use it for implementing invitation process as following: | |
1. | |
# Create new inactive user | |
user = User.objects.create(first_name='John', last_name='Doe', email='email@example.com', is_active=False) | |
# Generate expiration token valid for two days | |
token = generate_invitation_token(user.id, 60*60*24*2) | |
# Send invitation email |
This file contains 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
FROM nginx | |
# Install nodejs and try to cleanup some space in a single command | |
RUN apt-get update \ | |
&& apt-get install -y curl python build-essential \ | |
&& curl -sL https://deb.nodesource.com/setup_6.x | bash — \ | |
&& apt-get install -y nodejs \ | |
&& apt-get purge -y python build-essential \ | |
&& apt autoremove -y \ | |
&& apt-get clean -y | |
RUN mkdir -p /onebar/ui |
This file contains 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
# First, build the Ember-js project inside nodejs container | |
FROM node:6 | |
RUN mkdir -p /onebar/ui | |
RUN npm install -g ember-cli | |
RUN npm install -g bower | |
RUN echo ‘{ “allow_root”: true }’ > /root/.bowerrc | |
ADD ui/package.json /onebar/ui/package.json | |
WORKDIR /onebar/ui | |
RUN npm install | |
ADD ui/ /onebar/ui |
This file contains 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
FROM centos:7 | |
MAINTAINER "orion" <orion@thoughtspot.com> | |
# Steps needed to use systemd enabled docker containers. | |
# Reference: https://hub.docker.com/_/centos/ | |
ENV container docker | |
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ | |
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | |
rm -f /lib/systemd/system/multi-user.target.wants/*;\ | |
rm -f /etc/systemd/system/*.wants/*;\ |
This file contains 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
--- | |
- hosts: newnode | |
remote_user: root | |
become: yes | |
become_method: sudo | |
tasks: | |
- command: bash -c "uname -r | grep ^4." | |
register: kernelversion | |
ignore_errors: yes |
This file contains 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
" Specify a directory for plugins | |
" - For Neovim: ~/.local/share/nvim/plugged | |
" - Avoid using standard Vim directory names like 'plugin' | |
call plug#begin('~/.local/share/nvim/plugged') | |
" Make sure you use single quotes | |
" Airline is a plugin that makes the status line look fancier. | |
" It requires a custom font (with arrows), and is completely optional | |
Plug 'vim-airline/vim-airline' |
This file contains 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
# I really like this minimalistic zsh theme. | |
export ZSH_THEME="refined" | |
# This is important if you'd like to use TrueColor themes in Neovim | |
export NVIM_TUI_ENABLE_TRUE_COLOR=1 | |
# This makes Neovim your default editor | |
export VISUAL=nvim | |
export EDITOR="$VISUAL" |
This file contains 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
# A status line theme generated by tmuxline.vim | |
if-shell "test -f ~/.tmuxline" "source ~/.tmuxline" | |
set -g default-terminal "screen-256color" | |
# Enables a true-color support in Tmux | |
set-option -ga terminal-overrides ",xterm-256color:Tc" | |
# Moving between panes. | |
bind h select-pane -L | |
bind j select-pane -D |
This file contains 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
import logging | |
from abc import ABC, abstractmethod | |
from typing import Iterable, List | |
import requests | |
import numpy as np | |
logger = logging.getLogger(__name__) |
This file contains 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
syntax = "proto3"; | |
message TopKDocumentsRequest { | |
string query = 1; | |
int32 k = 2; | |
} | |
message DocumentsWithinDistanceRequest { | |
string query = 1; | |
double distance = 2; |
OlderNewer