Headless browsers are a web browser without a graphical user interface.
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 git | |
| g = git.cmd.Git(git_dir) | |
| g.pull() |
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 string import Template | |
| #open the file | |
| file = open( 'foo.txt' ) | |
| #read it | |
| template = Template( file.read() ) | |
| #document data | |
| title = "This is the title" | |
| subtitle = "And this is the subtitle" | |
| list = ['first', 'second', 'third'] |
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 os.path | |
| os.path.isfile(fname) |
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
| def write_content_to_file(content, file_path): | |
| output_file = os.fdopen(os.open(file_path, os.O_CREAT | os.O_WRONLY | os.O_EXCL), "w") | |
| output_file.write(content) | |
| output_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
| parser.add_argument('-l', '--list', help='Drafts list', action='store_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
| Settings > Editor > Code Style > Java | |
| Set values for: Tab size, Indent, Continuation indent |
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 '1.0.0-rc1' |
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 push origin '1.0.0-rc1' |
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
| # remove all .png extension from all files | |
| for i in $(ls *.png); do mv $i ${i%.png}; done | |
| # remove extensiosns from all files | |
| for i in $(ls *.*); do mv $i ${i%.*}; done | |
| # change extension from .html to .htm | |
| for i in $(ls *.html); do mv $i ${i%.html}.htm; done |