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
// ==UserScript== | |
// @name Fastmail - email body width | |
// @description Fix width of emails being wider than screen | |
// @author Will Jobs | |
// @id fastmail-emailwidth | |
// @include https://www.fastmail.com/mail/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant GM_addStyle | |
// ==/UserScript== |
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
# "enumerate_bin("1xx000") generates a vector of all binary strings: c("100000","101000","110000","111000") | |
enumerate_bin <- function(input_str) { | |
strlen<-nchar(input_str) | |
for(i in 1:strlen) { | |
if(tolower(substr(input_str,i,i))=="x") { | |
str0 <- paste(substr(input_str,1,i-1),"0",substr(input_str,i+1,strlen),sep="") | |
str1 <- paste(substr(input_str,1,i-1),"1",substr(input_str,i+1,strlen),sep="") | |
return(c(enumerate_bin(str0), enumerate_bin(str1))) | |
} | |
} |
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
#!/bin/bash | |
now=$(date +"%T") | |
echo "Starting backup at ${now}..." | tee -a /root/megabackup.log | |
SERVER="servername" | |
DAYS_TO_BACKUP=7 | |
WORKING_DIR="/root/backup_tmp_dir" | |
BACKUP_MYSQL="true" |
NewerOlder