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/bash | |
# Download CSV files from Linux server (iny my case, Raspberry Pi and Ubuntu) | |
# over SSH without the need to supply password. Note that Cygwin have to be | |
# used with this file since Git Bash uses other keyfiles. | |
# | |
# 1.Upload keyfiles: | |
# scp /home/username/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys2 | |
# 2. Don't forget to make file executable: | |
# chmod +x download.sh |
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
@echo off | |
REM Batch file to convert all DOCX files in the current directory to TXT files using Pandoc. | |
for %%f in (*.docx) do ( | |
echo %%~nf | |
pandoc -f docx -t plain -o "%%~nf.txt" "%%~nf.docx" | |
) |
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
# Hämta artikeldelningar per dag av Aftonbladets artiklar från 2014-06-01 till 2016-03-01. | |
df.ab <- GetSharesDf("SELECT '' title, DATE(pubdate) pubdate, SUM(fblikes) fblikes, SUM(fbshares) fbshares, SUM(fbcomments) fbcomments, SUM(twitter) twitter FROM articles WHERE sourcegroupid=1 AND DATE(pubdate) BETWEEN '2014-06-01' AND '2016-03-01' GROUP BY DATE(pubdate) ORDER BY retrieved ASC") | |
# Plotta ett mått i taget. | |
plotvar <- function(df, measure, title) | |
{ | |
df.m <- melt(df, id.vars = "pubdate", variable.name = measure) | |
gg <- ggplot(data=df.m, aes(as.Date(pubdate), value)) + | |
geom_line(size=1, color="#3b5998", alpha=0.6) + | |
scale_y_continuous(labels=scales::comma) + # Y-axel brytpunkter |
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
reverse.score = min.score + max.score - actual.score | |
# For example, a 7-point Likert scale where 1=good and 7=bad can be reversed scored as follows: | |
# 1 + 7 - 1 = 7 | |
# 1 + 7 - 2 = 6 | |
# 1 + 7 - 3 = 5 | |
# 1 + 7 - 4 = 4 | |
# 1 + 7 - 5 = 3 | |
# 1 + 7 - 6 = 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
aderton | |
adertonde | |
adjö | |
aldrig | |
all | |
alla | |
allas | |
allt | |
alltid | |
alltså |
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
/* | |
* NAME | |
* | |
* statistics-distributions.js - JavaScript library for calculating | |
* critical values and upper probabilities of common statistical | |
* distributions | |
* | |
* SYNOPSIS | |
* | |
* |
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
// Adapted from http://webapps.stackexchange.com/questions/19513/how-to-delete-all-events-on-many-dates-all-at-once-but-not-the-whole-calendar-in/47768#47768 | |
var fromDate = new Date(2016, 01, 1, 0, 0, 0); | |
var toDate = new Date(2016, 12, 31, 0, 0, 0); | |
removeEvents(fromDate, toDate, "MyFirstCalendar"); | |
removeEvents(fromDate, toDate, "MySecondCalendar"); | |
function removeEvents(fromDate, toDate, calendarName) { | |
var calendar = CalendarApp.getCalendarsByName(calendarName)[0]; |
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/python2 | |
# Credit: https://gist.github.com/nileshgr/3388917 | |
# Go to dev.twitter.com/apps and create a new app; put the information here. | |
# You need the tweepy library. | |
consumer_secret = '' | |
consumer_key = '' | |
access_token_key = '' |
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
# Source: | |
# Gelman, A., & Carlin, J. (2014). Beyond Power Calculations: Assessing Type S (Sign) and Type M (Magnitude) Errors. Perspectives on Psychological Science, 9(6), 641–651. | |
# https://doi.org/10.1177/1745691614551642 | |
# | |
# From p. 643: | |
# We have implemented these calculations in an R function, retrodesign(). | |
# The inputs to the function are D (the hypothesized true effect size), | |
# s (the standard error of the estimate), D (the statistical significance | |
# threshold; e.g., .05), and df (the degrees of freedom). The function | |
# returns three outputs: the power, the Type S error rate, and the |
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
# Disallow everything. | |
User-agent: * | |
Disallow: / | |
# Certain social media sites are whitelisted to allow crawlers to access page markup when links to /images are shared. | |
User-agent: Twitterbot | |
Allow: /images | |
User-agent: facebookexternalhit | |
Allow: /images |