Wrapper that allows you to pass options to app.run() on the command line. Example invocations:
$ ./server.py --host 0.0.0.0
$ ./server.py --host 127.0.1.1 --port 8000
$ ./server.py --debug
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
func remove(slice []string, s int) []string { | |
return append(slice[:s], slice[s+1:]...) | |
} |
#!/bin/bash | |
# script that will install the latest firefox and create a shelf icon | |
# Run: | |
# curl -sL https://git.io/fNbqF | bash - | |
if [ $(dpkg-query -W -f='${Status}' bzip2 2>/dev/null | grep -c "ok installed") -eq 0 ]; | |
then | |
sudo apt-get install -y bzip2; | |
fi |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello, world</title> | |
<style type="text/css"> | |
body { | |
background: #1c6ba0; | |
height: 100%; | |
border:0px; |
/* Hierarchial argument parsing, layered over getopt. | |
Copyright (C) 1995-2018 Free Software Foundation, Inc. | |
This file is part of the GNU C Library. | |
Written by Miles Bader <[email protected]>. | |
The GNU C Library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation; either | |
version 2.1 of the License, or (at your option) any later version. | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>LocalStorage example</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<style type="text/css"> | |
.container { | |
width: auto; | |
max-width: 780px; | |
padding: 0 15px; |
# run multiple scripts from a directory | |
ls example{1..2}.sh|xargs -n 1 -P 0 bash | |
# run the previous command as sudo | |
sudo !! | |
# a function to create a directory and move into it | |
function mkcd() { mkdir -p "$1" && cd "$_"; } | |
# remove lines that begin with '#' |
/** | |
* Python configuration test for openssl support | |
* Compile with: | |
* cc -pthread -o conftest conftest.c -lssl -lcrypto -lpthread -lutil | |
*/ | |
/* confdefs.h */ | |
#define _GNU_SOURCE 1 | |
#define _NETBSD_SOURCE 1 | |
#define __BSD_VISIBLE 1 | |
#define _DARWIN_C_SOURCE 1 |
The following NEW packages will be installed: | |
autotools-dev bsdmainutils debhelper debiandoc-sgml dh-python | |
dh-strip-nondeterminism distro-info-data docutils-common file gettext | |
gettext-base groff-base intltool-debian libarchive-zip-perl libasprintf0v5 | |
libcroco3 libexpat1 libffi6 libfile-stripnondeterminism-perl libglib2.0-0 | |
libhtml-parser-perl libhtml-tagset-perl libicu55 libmagic1 libmpdec2 libosp5 | |
libpipeline1 libpython3-stdlib libpython3.5-minimal libpython3.5-stdlib | |
libroman-perl libsgmls-perl libsqlite3-0 libtext-format-perl | |
libtimedate-perl libunistring0 liburi-perl libxml2 lsb-release man-db | |
mime-support opensp po-debconf python3 python3-docutils python3-minimal |