Skip to content

Instantly share code, notes, and snippets.

@LeeroyDing
LeeroyDing / Dockerfile
Created November 18, 2016 11:59
Sample Dockerfile for python web project
FROM python:2.7
MAINTAINER Leeroy Ding <[email protected]>
EXPOSE 8080
# Nodejs is required for npm, which will be used to install less
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get update && apt-get install -y \
nodejs libpq-dev libjpeg-dev ca-certificates python-openssl
constrain(iView, view, view.superview!) { i, v, s in
i.center == s.center
i.width == s.width / 2
v.top == s.top
v.bottom == i.top
v.height == s.height / 4
i.height == s.height / 2
}
@LeeroyDing
LeeroyDing / gist:9ffe9248896f3e4e6013
Created December 26, 2014 13:26
scp with lz4 compression
gtar -c somefolder | pv | lz4 -B4 | ssh example.com "lz4 -d | tar x"
# First style
if something is not None: # or whatever condition
big_block_of_code()
# Second style
if something is None: # or whatever condition
continue # or return None or whatever
big_block_of_code()
In file included from RequestGroupMan.cc:35:
In file included from ./RequestGroupMan.h:50:
./IndexedList.h:67:37: error: no type named 'size_type' in
'std::__1::__deque_iterator<std::__1::pair<std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::pair<unsigned
long long, aria2::SharedHandle<aria2::RequestGroup> >, std::__1::__tree_node<std::__1::pair<unsigned long long,
aria2::SharedHandle<aria2::RequestGroup> >, void *> *, long> >, aria2::SharedHandle<aria2::RequestGroup> >,
std::__1::pair<std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::pair<unsigned long long,
aria2::SharedHandle<aria2::RequestGroup> >, std::__1::__tree_node<std::__1::pair<unsigned long long,
aria2::SharedHandle<aria2::RequestGroup> >, void *> *, long> >, aria2::SharedHandle<aria2::RequestGroup> > *,
std::__1::pair<std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::pair<unsigned long long,