Run Raspberry 3 in digital signage mode with Chromium Web browser on a TV screen
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
Basically, to make it work and have it resolve DNS queries, you need to disable systemd-resolved as it monopolizes the /etc/resolv.conf file, more about this process here https://fedoraproject.org/wiki/Changes/systemd-resolved. | |
sudo systemctl disable systemd-resolved | |
sudo systemctl stop systemd-resolved | |
sudo bash -c 'mkdir -p /etc/systemd/system-preset && echo "disable systemd-resolved.service" >/etc/systemd/system-preset/20-systemd-resolved-disable.preset' | |
Then reboot, and don't worry it is normal that you do not have internet at that point. We need to delete an old symlink left over from systemd-resolved operations. | |
rm /etc/resolv.conf |
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 bs4 import BeautifulSoup, NavigableString, Tag | |
def html_to_text(html): | |
"Creates a formatted text email message as a string from a rendered html template (page)" | |
soup = BeautifulSoup(html, 'html.parser') | |
# Ignore anything in head | |
body, text = soup.body, [] | |
for element in body.descendants: | |
# We use type and not isinstance since comments, cdata, etc are subclasses that we don't want | |
if type(element) == NavigableString: |
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
<?php | |
// edit these lines: | |
// example: /var/www/repositories/project.git | |
$repo_dir = '~/repository.git'; | |
// example: /var/www/project | |
$web_root_dir = '~/project'; | |
// example: /var/www/project/scripts/post_deploy.sh |
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
library(MBESS) | |
library(pwr) | |
nSims <- 100000 #number of simulated experiments | |
p <-numeric(nSims) #set up empty container for all simulated p-values | |
obs_pwr <-numeric(nSims) #set up empty container | |
t <-numeric(nSims) #set up empty container | |
d_all<-numeric(nSims) | |
N<-33 #number of participants |
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 | |
from scipy import stats | |
from itertools import combinations | |
from statsmodels.stats.multitest import multipletests | |
from statsmodels.stats.libqsturng import psturng | |
import warnings | |
def kw_dunn(groups, to_compare=None, alpha=0.05, method='bonf'): | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# The code given in #2 gist is not in R. There is a change in formula compared to the one in this blog post and the one used by Evan Miller's tool (#3). http://www.alfredo.motta.name/ab-testing-from-scratch/#easy-footnote-bottom-24-982 | |
#1. https://stats.stackexchange.com/questions/357336/create-an-a-b-sample-size-calculator-using-evan-millers-post | |
#2. https://gist.github.com/mottalrd/7ddfd45d14bc7433dec2#file-gistfile1-txt | |
#3. https://www.evanmiller.org/ab-testing/sample-size.html | |
p = 0.03 | |
pct_mde = 0.1 | |
alpha = 0.05 | |
power = 1- 0.2 |
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 python3 | |
""" | |
To use: | |
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client | |
2. install pandoc and pypandoc, also tqdm | |
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials | |
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub | |
""" | |
import re | |
import sys |
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/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |