Skip to content

Instantly share code, notes, and snippets.

View capsulecorplab's full-sized avatar

Sean Marquez capsulecorplab

View GitHub Profile
@capsulecorplab
capsulecorplab / search_biopython.py
Created April 25, 2017 12:50 — forked from bonzanini/search_biopython.py
Searching PubMed with Biopython
# 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'
@capsulecorplab
capsulecorplab / one_step_at_a_time.ipynb
Last active December 30, 2017 17:50
one_step_at_a_time
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@capsulecorplab
capsulecorplab / undecorator.py
Last active April 4, 2018 21:52
Examines a string argument, `dump`, and Extracts all substring elements sandwiched between the given `front` and `back` criteria, and puts them in a list
def undecorate(dump,front,back):
""" dump: string containing desired substring elements
front: string element preceding desired substring element
back: string element following desired substring element
"""
output = []
while front in dump:
start = dump.find(front) + len(front)
end = dump.find(back, start)
if end > 0:
@capsulecorplab
capsulecorplab / there_is_no_try.py
Created February 1, 2018 01:53
Try with Timeout
#code gist, courtesy of Jabba Laci
#sauce: https://pythonadventures.wordpress.com/2012/12/08/raise-a-timeout-exception-after-x-seconds/
import signal
import time
def test_request(arg=None):
"""Your http request."""
time.sleep(2)
return arg
@capsulecorplab
capsulecorplab / startnode.sh
Last active February 17, 2018 06:52
Run using `sh startnode.sh` or make executable using `chmod +x startnode.sh` and run using ./startnode.sh
#!/bin/bash
# Bash command for running geth
geth --networkid 4224 --mine --minerthreads 2 --datadir "." --nodiscover --rpc --rpcport "8545" --port "30303" --rpccorsdomain "*" --nat "any" --rpcapi eth,web3,personal,net --unlock 0 --password ~/ChainSkills/private/password.sec --ipcpath "~/.ethereum/geth.ipc"
@capsulecorplab
capsulecorplab / Escrow.sol
Last active February 24, 2018 06:20
Smart contract for simulating an escrow
pragma solidity ^0.4.18;
contract Escrow {
enum State {AWAITING_PAYMENT, AWAITING_DELIVERY, COMPLETE, REFUNDED}
modifier buyerOnly() {
require(msg.sender == buyer);
_;
}
@capsulecorplab
capsulecorplab / Instructors.sol
Created February 24, 2018 06:20
Smart contract for using struct and mapping
pragma solidity ^0.4.19;
contract Instructors {
struct Instructor {
uint age;
string fName;
string lName;
}
@capsulecorplab
capsulecorplab / automate_all_the_things.adoc
Last active December 28, 2020 20:40
a list of miscellaneous automation and productivity tools
@capsulecorplab
capsulecorplab / space_mission_firesat.yaml
Last active December 4, 2022 12:16
A template for serializing the Space Mission Analysis & Design (SMAD) process using the hypothetical 'FireSat' space mission.
# This yaml file is a (draft) template for serializing the Space Mission
# Analysis & Design (SMAD) process using the hypothetical 'FireSat' space
# mission from the SMAD handbook, by Wiley Larson & James Wertz (3rd edition).
#
# More info on yaml syntax and usage can be found here:
# https://learnxinyminutes.com/docs/yaml/
# yaml files can be validated on http://www.yamllint.com/
#####################
# Mission Statement #
@capsulecorplab
capsulecorplab / keybase.md
Created March 29, 2018 21:57
Keybase proof

Keybase proof

I hereby claim:

  • I am capsulecorplab on github.
  • I am drbriefs (https://keybase.io/drbriefs) on keybase.
  • I have a public key ASC68ubm3bb2nY76GeZZcNzWH_2roXD3kNSob1idNrOA2Qo

To claim this, I am signing this object: