There are two types of markup in Liquid: Output and Tag.
- Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
- Tag markup (which cannot resolve to text) is surrounded by
class Timeit(object): | |
def __init__(self, tag): | |
self.tag = tag | |
def __enter__(self): | |
self.start = time.time() | |
def __exit__(self, *unused): | |
self.cost = time.time() - self.start |
class ConnectionPool(): | |
""" | |
Usage: | |
conn_pool = nmi_mysql.ConnectionPool(config) | |
db = conn_pool.get_connection() | |
db.query('SELECT 1', []) | |
conn_pool.return_connection(db) | |
conn_pool.close() |
# -*- coding: utf-8 -*- | |
""" | |
sync device status data from hive | |
""" | |
import argparse | |
import json |
#!/bin/bash | |
# | |
# Ubuntu安装并配置aria2 | |
# | |
# @Author: Jaeger <JaegerCode@gmail.com> | |
# @Version: 0.1 | |
#配置文件下载保存路径 | |
downloadPath='/user-files/superuser/dl' |
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib | |
# in an Alpine based Docker image. | |
FROM alpine:3.4 | |
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | |
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev | |
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h | |
RUN pip install numpy scipy pandas matplotlib | |
There are two types of markup in Liquid: Output and Tag.
{{ matched pairs of curly brackets (ie, braces) }}
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
Math.random()
. There are extremely few cases where Math.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.uuid
, specifically the uuid.v4()
method. Avoid node-uuid
- it's not the same package, and doesn't produce reliably secure random values.random-number-csprng
.You should seriously consider reading the entire article, though - it's
version: "3" | |
services: | |
mongo1: | |
image: mvertes/alpine-mongo | |
restart: always | |
ports: | |
- "27017:27017" | |
entrypoint: [ "/usr/bin/mongod", "--port", "27017", "--bind_ip_all", "--replSet", "rs"] | |
function level1() { | |
function level2() { | |
; | |
} | |
} | |
function level1_1() { | |
; | |
} |
var esprima = require("esprima"); | |
var estraverse = require("estraverse"); | |
var ast = esprima.parse(` | |
function level1() { | |
function level2() { | |
; | |
} | |
} | |
function level1_1() { |