Skip to content

Instantly share code, notes, and snippets.

@wischweh
wischweh / price-regexp.txt
Last active August 10, 2024 02:23
This Regexp tries to grep a price from a string
// This Regexp tries to grep a price from a string.
// 1. The number must makes sense. it may contain "." or "," i.e 1 1.000,99 10,0 etc
// 2. The String must conatin a currency identifier like EUR,USD,€ or $.
// 2a) The currency identifer may be at the begining or at the end of the matching string
// 2b) There may be a space between value and currency identifier
// This regexp is based upon http://stackoverflow.com/questions/1547574/regex-for-prices
(USD|EUR|€|\$|£)\s?(\d{1,}(?:[.,]\d{3})*(?:[.,]\d{2}))|(\d{1,3}(?:[.,]\d{3})*(?:[.,]\d{2})?)\s?(USD|EUR)
updated Version (also matches numbers without delimiters in between like $2 $34 thx PepsiX for pointing out this issue:
@nickoala
nickoala / 0_python_email.md
Last active October 16, 2024 18:32
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@fatherofluqmaan
fatherofluqmaan / multi-simbot-script.sh
Last active September 9, 2021 23:32
A script to run all pairs on Coinbase Pro with the pycryptobot created by Michael Whittle
#!/usr/bin/env bash
rm short-simbot-run.txt
dte=$(date +"%Y-%m-%d %T")
dt=$(date +"%Y-%m-%d")
c=$(< "pairs.txt" wc -l)
a="$c"
simst='2021-07-25'
simen='2021-08-05'