This file contains 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 datetime import datetime, timedelta, date | |
def start_and_end_of_month(d,return_datetime=True): | |
if return_datetime: | |
if isinstance(d,date): | |
d=datetime(d.year,d.month,d.day) | |
start = d.replace(day=1) | |
next_month=d.replace(day=28)+timedelta(days=4) | |
end = next_month - timedelta(days=1)+timedelta(hours=23,minutes=59,seconds=59) |
This file contains 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
Public Sub FindExtValidation() | |
Dim ws As Worksheet | |
For Each ws In ActiveWorkbook.Sheets | |
ws.Activate | |
On Error Resume Next | |
Set v1 = ws.Cells.SpecialCells(xlCellTypeAllValidation) | |
If Err.Number > 0 Then | |
GoTo next_sheet | |
End If |
This file contains 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
sed -r 's/^([^:]+):([^:])([^:]?)([^:]?)([^:]*):(.*)$/\1:\2\3\4:\6/w shadowredacted' < shadow |
This file contains 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 numpy as np | |
data = np.arange(1, 7) | |
groups = np.array([0,0,1,2,2,1]) | |
unique_groups = np.unique(groups) | |
sums = [] | |
for group in unique_groups: | |
sums.append(data[groups == group].sum()) |
This file contains 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
Here's the brute-force approach. It also removes the configuration of the repo. | |
You need to save first the gitignore | |
Step 1: remove all history | |
rm -rf .git | |
Step 2: reconstruct the Git repo with only the current content |
This file contains 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
function GenerateDigest() { | |
//Function that goes through a search query based on time and optional label in gmail, strips html, collates into a single email, sends it to a desired address and then labels the emails as processed. | |
// Where the digest email is going | |
var to_emailAddress = "tomail@somedomain.com"; | |
//We calculate the 24 hour range, I plan to run this every day at 9:00 to get last 24 hours of emails | |
var month = new Date().getMonth(); |