Switch to the Python version you want to use:
| FROM elixir:1.11.1-alpine AS build | |
| # install build dependencies | |
| RUN apk add --no-cache build-base npm git | |
| # prepare build dir | |
| WORKDIR /app | |
| # install hex + rebar | |
| RUN mix local.hex --force && \ |
| defmodule LinkedList do | |
| defstruct data: 0, | |
| next: nil, | |
| index: 0 | |
| def new(data \\ 0, index \\ 0) do | |
| %__MODULE__{data: data, index: index} | |
| end | |
| def push( |
| ########################################################### | |
| # How to NEVER use lambdas. An inneficient and yet educa- # | |
| # tonal [sic] guide to the proper misuse of the lambda # | |
| # construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] # | |
| # original by (and apologies to): e000 (13/6/11) # | |
| # now in Python 3 courtesy of: khuxkm (17/9/20) # | |
| ########################################################### | |
| ## Part 1. Basic LAMBDA Introduction ## | |
| # If you're reading this, you've probably already read e000's |
| """ | |
| Gist made by Kshitij Chawla (Github name: kchawla-pi) for the Nilearn library in Feb/March 2019. | |
| GPLv3 | |
| """ | |
| def replace_parameters(replacement_params, | |
| end_version='future', | |
| lib_name='Nilearn', | |
| ): | |
| """ |
| import pathlib | |
| import sys | |
| import sh | |
| def clone_if_not_exists(name, url, **kwargs): | |
| if not pathlib.Path(name).exists(): | |
| print("Cloning", url, "...") | |
| sh.git.clone(url, name, depth=1, **kwargs) |
| ''' | |
| This is an example of the server-side logic to handle slash commands in | |
| Python with Flask. | |
| Detailed documentation of Slack slash commands: | |
| https://api.slack.com/slash-commands | |
| Slash commands style guide: | |
| https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c | |
| ''' |
| #!/usr/bin/env python | |
| # | |
| # clock_skew.py | |
| # This script reads json data from /tmp/sigsci-agents.json | |
| # and prints a message if an agent's clock skew is greater | |
| # or equal to the defined thresholds. | |
| # | |
| # SigSciApiPy (https://github.com/signalsciences/SigSciApiPy) is | |
| # an easy way to pull agent data from the Signal Sciences API and | |
| # save it to /tmp/sigsci-agents.json |
| #!/usr/bin/env bash | |
| # clock_skew.sh - Check remote hosts for clock skew (time drift), and | |
| # output a warning or alert message based on defined thresholds. | |
| # | |
| # Instructions: | |
| # Create a hosts.txt file that contains the list of hosts to be checked. | |
| # | |
| # hosts.txt should contain one host entry per line, and username and | |
| # port fields are optional. Format: | |
| # |
| Edit mc’s ini file (either ~/.mc/ini or ~/.config/mc/ini) and look for the line [Colors]. Then, change the line base_color to this: | |
| [Colors] | |
| base_color=linux:normal=white,black:marked=yellow,black:input=,green:menu=black:menusel=white:menuhot=red,:menuhotsel=black,red:dfocus=white,black:dhotnormal=white,black:dhotfocus=white,black:executable=,black:directory=white,black:link=white,black:device=white,black:special=white,black:core=,black:stalelink=red,black:editnormal=white,black |