start new:
tmux
start new with session name:
tmux new -s myname
| import types | |
| import tensorflow as tf | |
| import numpy as np | |
| # Expressions are represented as lists of lists, | |
| # in lisp style -- the symbol name is the head (first element) | |
| # of the list, and the arguments follow. | |
| # add an expression to an expression list, recursively if necessary. | |
| def add_expr_to_list(exprlist, expr): |
| pragma solidity ^0.4.19; | |
| contract ERC721 { | |
| string constant private tokenName = "My ERC721 Token"; | |
| string constant private tokenSymbol = "MET"; | |
| uint256 constant private totalTokens = 1000000; | |
| mapping(address => uint) private balances; | |
| mapping(uint256 => address) private tokenOwners; | |
| mapping(uint256 => bool) private tokenExists; | |
| mapping(address => mapping (address => uint256)) private allowed; | |
| mapping(address => mapping(uint256 => uint256)) private ownerTokens; |
Hopefully this will answer "How do I setup or start a Django project?" I was trying to set up my own website, and there was a lot to read, learn and digest! Therefore, I put this together which is a collection of all the guides/blog posts/articles that I found the most useful. At the end of this, you will have your barebones Django app configured and ready to start building :)
NOTE: This guide was built using Django 1.9.5, NodeJS 4+ with NPM 3+
| """Base class for implementing Lambda handlers as classes. | |
| Used across multiple Lambda functions (included in each zip file). | |
| Add additional features here common to all your Lambdas, like logging.""" | |
| class LambdaBase(object): | |
| @classmethod | |
| def get_handler(cls, *args, **kwargs): | |
| def handler(event, context): | |
| return cls(*args, **kwargs).handle(event, context) | |
| return handler |
| { | |
| "Statement":[ | |
| { | |
| "Effect":"Allow", | |
| "Action":[ | |
| "s3:ListAllMyBuckets" | |
| ], | |
| "Resource":"arn:aws:s3:::*" | |
| }, |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| # sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| # sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| # sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| # sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
| <main> | |
| <section v-for="(day, index) in schedule"> | |
| <header> | |
| Day {{index+1}} — {{day.date | date}} | |
| </header> | |
| <ul> | |
| <li v-for="slot in day.agenda" v-bind:class="{ current: checkTime(slot.range[0], slot.range[1]) }"> | |
| <h3><b>{{slot.display.h}}</b>{{slot.display.m}}{{slot.display.a}}</h3> | |
| <div v-html="slot.desc"></div> | |
| <div><small v-html="slot.location"></small></div> |