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 pytest | |
def merge_dict(a, b): | |
for key in b: | |
if key in a: | |
if isinstance(a[key], dict) and isinstance(b[key], dict): | |
merge_dict(a[key], b[key]) | |
elif a[key] == b[key]: | |
pass |
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
#!/bin/bash | |
curl ${SLAVE_JAR_URL} -o /var/lib/jenkins/agent.jar | |
#/etc/systemd/system/sebasshtian.service | |
cat << EOF > /etc/systemd/system/jenkins-slave.service | |
[Unit] | |
Description=Jenkins-slave | |
After=network.target |
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
#!/bin/sh | |
TOKEN= | |
CHAT_ID= | |
curl -s -X POST https://api.telegram.org/bot${TOKEN}/sendMessage -d chat_id=$CHAT_ID -d text="$1" |
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 Composable(object): | |
''' A function decorator that allows you to use Haskell style dot notation for function composition ''' | |
fns = {} | |
def __init__(self, fn): | |
self.fn = fn | |
Composable.fns[fn.__name__] = fn | |
def __call__(self, *args, **kwargs): | |
''' simply calls the function ''' |
NewerOlder