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
| git config gitflow.feature.finish.no-ff true |
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
| brew install postgresql | |
| brew tap homebrew/services | |
| brew services start postgresql | |
| brew services list |
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 Point: | |
| def __init__(self, x, y): | |
| self.x = x | |
| self.y = y | |
| def __call__(self, x, y): | |
| self.x = x | |
| self.y = y | |
| point = Point(5, 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 class_a(object): | |
| def speak(self): | |
| print("class_a sinifindan cagirildi") | |
| class class_b(class_a, object): | |
| def speak(self): | |
| print("class_b sinifindan cagirildi") | |
| super(class_b, self).speak() | |
| class class_c(class_a, object): |
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 base64 | |
| file_data = base64.urlsafe_b64decode(pdf.encode('utf8')) | |
| with open('pdf_name.pdf', 'wb') as file: | |
| file.write(file_data) | |
| return pdf |
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
| str = 'Your byte string' | |
| file = open('xmlToSave.xml', 'wb') | |
| file.write(str.decode('base64')) | |
| file.close() |
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
| git tag -d 12345 | |
| git push origin :refs/tags/12345 |
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 | |
| docker inspect -f '{{ .NetworkSettings.IPAddress }}' <container_name> |
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
| from suds.sudsobject import asdict | |
| def recursive_asdict(d): | |
| """Convert Suds object into serializable format.""" | |
| out = {} | |
| for k, v in asdict(d).iteritems(): | |
| if hasattr(v, '__keylist__'): | |
| out[k] = recursive_asdict(v) | |
| elif isinstance(v, list): | |
| out[k] = [] |
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 | |
| redis-cli -h remote_host -p remote_port |