This gist consists of a makefile and a script that can automate the creation of PDFs from Slidify generated HTML slides. The script assumes that the makefile and the script makepdf.js are in the same directory as the Rmd file. The makepdf.js script uses casperjs, a very useful utility to automate tasks that require browser interaction. You may follow the installation instructions on the casperjs website, to make sure that you have all the dependencies correctly installed before trying this out.
This file contains hidden or 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
| getSymbols("^GSPC", from="1950-01-01") | |
| p = 10 | |
| a = na.omit(merge( volatility(GSPC, n=p)*100, lag(volatility(GSPC, n=p), k=-p)*100 )) | |
| names(a) = c("hv", "rv") | |
| medianvalues = c() | |
| meanvalues = c() | |
| maxvalues = c() | |
| minvalues = c() | |
| keys = c() | |
| for ( x in seq( 0, max(a$hv), 2 ) ) |
This file contains hidden or 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 python3 | |
| import boto3, argparse | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('-b','--bucket', help='Name of your S3 Bucket', required=True) | |
| parser.add_argument('-o','--object', help='Name of the object + prefix in your bucket', required=True) | |
| parser.add_argument('-t','--time', type=int, help='Expirery in seconds Default = 60', default=60) | |
| args = vars(parser.parse_args()) |
This file contains hidden or 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 are a few methods for getting text from PDF files. Do read through | |
| # the instructions carefully! NOte that this code is written for Windows 7, | |
| # slight adjustments may be needed for other OSs | |
| # Tell R what folder contains your 1000s of PDFs | |
| dest <- "G:/somehere/with/many/PDFs" | |
| # make a vector of PDF file names | |
| myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE) |
This file contains hidden or 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
| library(shiny) | |
| library(dplyr) | |
| library(lubridate) | |
| # Load libraries and functions needed to create SQLite databases. | |
| library(RSQLite) | |
| library(RSQLite.extfuns) | |
| saveSQLite <- function(data, name){ | |
| path <- dplyr:::db_location(filename=paste0(name, ".sqlite")) |
This file contains hidden or 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
| library(shiny) | |
| library(datasets) | |
| Logged = FALSE; | |
| PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad") | |
| # Define server logic required to summarize and view the selected dataset | |
| shinyServer(function(input, output) { | |
| source("www/Login.R", local = TRUE) | |
| observe({ | |
| if (USER$Logged == TRUE) { |
This file contains hidden or 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
| julia> using TimeSeries, MarketTechnicals, MarketData, Lazy | |
| julia> @> OHLC doji findall x->OHLC[x] x->x.timestamp | |
| 166-element Array{Date{ISOCalendar},1}: | |
| 1962-03-02 | |
| 1962-04-13 | |
| 1962-07-16 | |
| 1962-10-08 | |
| 1963-02-08 | |
| 1963-05-22 |
This file contains hidden or 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
| ################################################### | |
| ## | |
| ## Functions for calculating AUC and plotting ROC | |
| ## Corey Chivers, 2013 | |
| ## corey.chivers@mail.mcgill.ca | |
| ## | |
| ################################################### | |
| ## Descrete integration for AUC calc |
This file contains hidden or 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
| \documentclass[letter,$if(fontsize)$$fontsize$,$else$10pt,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$]{ucbletter} | |
| \usepackage[T1]{fontenc} | |
| \usepackage{mathpazo} | |
| \usepackage{amssymb,amsmath} | |
| \linespread{$if(linespread)$$linespread$$else$1.1$endif$} | |
| \usepackage{ifxetex,ifluatex} | |
| \usepackage{fixltx2e} % provides \textsubscript | |
| % use upquote if available, for straight quotes in verbatim environments | |
| \IfFileExists{upquote.sty}{\usepackage{upquote}}{} | |
| \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex |
This file contains hidden or 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
| library(shiny) | |
| library(ggplot2) | |
| # Download DataTables JS file and TableTools full package from http://datatables.net/download/ | |
| # Change the paths appropriately: | |
| addResourcePath('datatables','/Users/yourusername/Downloads/DataTables-1.9.4/media') | |
| addResourcePath('tabletools','/Users/yourusername/Downloads/TableTools-2.1.5/media') | |
| runApp(list( | |
| ui = basicPage( |