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
@media print { | |
h1, h2, h3, h4 { | |
page-break-after: avoid; | |
} | |
h2 { | |
page-break-before: always; | |
} | |
pre, ol, ul, table, blockquote, div.figure, div.org-src-container, div.sidebar { | |
page-break-inside: avoid; | |
} |
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
(defun if/pdf-isbn-or-doi-to-bibtex () | |
(let ((user-input (read-string "isbn/doi/pdf-path: " (car kill-ring)))) | |
(cond | |
((string-match-p "^10.[0-9]\\{4,9\\}/[-._;()/:A-Z0-9]+$" user-input) (doi-utils-doi-to-bibtex-string user-input)) ;doi | |
((string-match-p "pdf" user-input) (if/org-ref-pdf-to-bibtex user-input)) ;pdf | |
(t (if/isbn-to-bibtex user-input))))) | |
(defun if/start-org-roam-capture (uri) | |
(kill-new (replace-regexp-in-string "file:\/\/" "" uri)) | |
(setq org-roam-capture--in-process nil) |
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 adapted from http://mpastell.com/2009/09/11/matlab-style-stem-plot-with-r/ | |
stem = function(x,y,slope,intercept,pch=16,linecol=2,clinecol=1,lty=2,from_mean=FALSE,...){ | |
if (missing(y)){ | |
y = x | |
x = 1:length(x) | |
} | |
#this plots the points | |
plot(x,y,pch=pch,...) | |
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
#!/usr/bin/env python | |
import os | |
import sys | |
import subprocess | |
import shlex | |
def notify (token, mymessage, mytitle): | |
# Default config |
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 response = notifyBoxcar(token,mytitle,message) | |
url = 'https://new.boxcar.io/api/notifications'; | |
body = {'user_credentials', token, ... | |
'notification[title]', mytitle, ... | |
'notification[long_message]', message, ... | |
'notification[source_name]', 'Matlab script', ... | |
'notification[icon_url]' , 'http://www.mathworks.com/cmsimages/64848_wl_cc_logo_membrane_2002_wl.gif', ... | |
'notification[sound]' , 'clanging' | |
}; | |
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
notifyBoxcar = function(token,mytitle,message){ | |
require(httr) | |
query = POST("https://new.boxcar.io/api/notifications", | |
body = list("user_credentials" = token, | |
"notification[title]" = mytitle, | |
"notification[long_message]" = message, | |
"notification[sound]" = "clanging", | |
"notification[source_name]" = "R script", | |
"notification[icon_url]" = "http://www.r-project.org/Rlogo.jpg")) | |
stop_for_status(query) |
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
#!/usr/bin/Rscript --vanilla | |
########################################################### | |
## ## | |
## elastic.R ## | |
## ## | |
## Author: Tony Fischetti ## | |
## tony.fischetti@gmail.com ## | |
## ## | |
########################################################### |