Crate a router
extern crate iron;
extern crate router;
use iron::prelude::*;
use iron::status;
use router::Router;
call plug#begin('~/.vim/plugged') | |
" Color Scheme | |
Plug 'morhetz/gruvbox' | |
" Syntax highlight | |
Plug 'sheerun/vim-polyglot' | |
Plug 'vim-airline/vim-airline' | |
Plug 'preservim/nerdtree' |
import Foundation | |
struct Lens<Whole, Part> { | |
let view: (Whole) -> Part | |
let set: (Part, Whole) -> Whole | |
} | |
protocol LensCompatible {} |
import Foundation | |
import RxSwift | |
import RxCocoa | |
class HTTPClient { | |
private let session = URLSession.shared | |
func request(_ method: String = "GET", url: String, |
extern crate hyper; | |
extern crate futures; | |
extern crate tokio_core; | |
use std::io::{self, Write}; | |
use futures::{Future, Stream}; | |
use hyper::Client; | |
use tokio_core::reactor::Core; | |
fn main() { |
Crate a router
extern crate iron;
extern crate router;
use iron::prelude::*;
use iron::status;
use router::Router;
def write(filepath, content): | |
folder = os.path.dirname(filepath) | |
if not os.path.isdir(folder): | |
os.makedirs(folder) | |
with open(filepath, 'wb') as f: | |
f.write(content.encode('utf-8')) |
def create_flask_app(config=None): | |
app = Flask(__name__) | |
#: load default configuration | |
app.config.from_object('diadem.settings') | |
#: load environment configuration | |
if 'DIADEM_CONF' in os.environ: | |
app.config.from_envvar('DIADEM_CONF') |