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 | |
| # | |
| # loc_counter.sh - Count lines of code by file extension in a directory | |
| # | |
| # Usage: | |
| # ./loc_counter.sh [directory_path] | |
| # | |
| # If no directory_path is provided, it defaults to the current directory. | |
| set -e |
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 | |
| # Mouse mover script for macOS using cliclick | |
| # Moves mouse every 5 minutes to prevent sleep/screensaver | |
| # Install cliclick first: brew install cliclick | |
| # Configuration | |
| INTERVAL=300 # 5 minutes in seconds | |
| MOVE_DISTANCE=10 # pixels to move | |
| LOG_FILE="./mouse_mover.log" |
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
| # To run: python just_text.py > text | |
| ### | |
| from glob import glob | |
| # | |
| import warc | |
| # List any of the WARC files found in the data folder | |
| warc_files = glob('data/*.wet.gz') | |
| # Process each of the WARC files we 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
| # you need to install Biopython: | |
| # pip install biopython | |
| # Full discussion: | |
| # https://marcobonzanini.wordpress.com/2015/01/12/searching-pubmed-with-python/ | |
| from Bio import Entrez | |
| def search(query): | |
| Entrez.email = 'your.email@example.com' |
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
| #' Get a PubMed search index | |
| #' @param query a PubMed search string | |
| #' @return the XML declaration of the search | |
| #' @example | |
| #' # Which articles discuss the WHO FCTC? | |
| #' pubmed_ask("FCTC OR 'Framework Convention on Tobacco Control'") | |
| pubmed_ask <- function(query) { | |
| # change spaces to + and single-quotes to URL-friendly %22 in query | |
| query = gsub("'", "%22", gsub(" ", "+", query)) |