This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check existing | |
- name: Ansible check file exists. | |
stat: | |
path: /etc/filename | |
register: file_status | |
- debug: | |
msg: "File exists..." | |
when: file_status.stat.exists | |
- debug: | |
msg: "File not found" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import os | |
import argparse | |
from urllib import request | |
from urllib.parse import urljoin | |
from html.parser import HTMLParser | |
class ArticleParser(HTMLParser): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -ex | |
## This is current directory | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
###### | |
# Add variables to travis encrypted section | |
###### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# help set | |
set -e # Exit immediately if a command exits with a non-zero status. | |
set -x # Print commands and their arguments as they are executed. | |
# Export same evironment as process has | |
strings /proc/$PID/environ | |
strings /proc/20316/environ | awk '{ print "export "$1}' >> export_env.sh | |
source export_env.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NeuralNetwork(object): | |
... | |
def predict(self, x): | |
layer1 = sigmoid(np.dot(x, self.weights1)) | |
output = sigmoid(np.dot(layer1, self.weights2)) | |
return output | |
x_seen = np.array([1, 1, 0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from abc import ABC, abstractmethod | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.ticker as ticker | |
class EnvData(object): | |
def __init__(self, step: int, gas_price: float, consumption: float): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Reset in case getopts has been used previously in the shell. | |
OPTIND=1 | |
DRY_RUN=0 | |
KEEP_MONTHS=6 # remove only branches older than keep value | |
GIT_REF_PREFIX="refs/remotes/origin" | |
EXCLUDE=('INT' 'QA' 'STAGE' 'master') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "venv" | |
version = "1.0" | |
description = "venv project" | |
authors = ["venv"] | |
[tool.poetry.dependencies] | |
python = "^3.5.2" | |
Django = "=1.11.14" | |
stripe = "=1.43.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OPEN_BRACKETS = '[{(' | |
CLOSING_BRACKETS = ']})' | |
def is_matching(open_bracket: str, close_bracket: str) -> bool: | |
return OPEN_BRACKETS.index(open_bracket) == \ | |
CLOSING_BRACKETS.index(close_bracket) | |
def is_balanced(input_string: str) -> bool: |