Skip to content

Instantly share code, notes, and snippets.

😕
Why does GitHub need statuses?

Alice WheresAlice

View GitHub Profile
@WheresAlice
WheresAlice / Leeds Food.md
Created Feb 9, 2019
I took your recommendations and collated a list of Leeds food recommendations
View Leeds Food.md
@WheresAlice
WheresAlice / backup.sh
Last active Jan 8, 2019
Backup your github repos to Bitbucket
View backup.sh
# Usage: change username:password to either an app-password or your actual password
# Change WheresAlice to your actual username on Bitbucket.org
# Run this script from the directory with all your GitHub checkouts in
# @TODO - Due to Mac limitations of 'find' we are listing all files, not just directories
# @TODO - Get a list of GitHub repos and clone them all
# @TODO - Do this for GitLab too
# Replace my_token with a token from https://github.com/settings/tokens and then uncomment this line in order to clone the first 100 of your github repositories
# curl 'https://api.github.com/user/repos?access_token=my_token&affiliation=owner&per_page=100' | gron | grep ssh_url | cut -d'"' -f2 | xargs -I {} git clone {}
@WheresAlice
WheresAlice / User Growth.png
Last active Jan 3, 2019
Predict future growth of your Slack org using R and Facebook's Prophet library
@WheresAlice
WheresAlice / yum_repo_test.rb
Last active Dec 28, 2018
Test the health of a yum repository, ensuring that the repomd.xml file and linked data files can all be downloaded. Usage: `ruby yum_repo_test.rb http://pkg.jenkins.io/redhat-stable/repodata`
View yum_repo_test.rb
require 'open-uri'
require 'nokogiri'
BASE_PATH = ARGV[0].freeze
@repomd = Nokogiri::XML(open(File.join(BASE_PATH, 'repomd.xml')).read)
def test_path(type)
href = @repomd.xpath("/xmlns:repomd/xmlns:data[@type=\"filelists\"]/xmlns:location").first['href']
full_path = File.join(File.dirname(BASE_PATH), href)
View README.md
@WheresAlice
WheresAlice / Chrome.md
Last active Sep 19, 2018
Making Chrome more usable
View Chrome.md

Fix Chrome 69 UI changes:

  • chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains - set to disable to show www. and m.
  • chrome://flags/#top-chrome-md - set to normal to get classic mode

Remove mobile junk:

  • chrome://flags/#enable-ntp-remote-suggestions - set to Disabled to hide content suggestions on the new tab page
  • chrome://flags/#enable-ntp-bookmark-suggestions - set to Disabled to hide bookmarks on the new tab page
  • chrome://flags/#enable-ntp-suggestions-notifications - set to Disabled to not get notifications about new content
@WheresAlice
WheresAlice / Dockerfile
Created Sep 7, 2018
papermill dockerfile. This technically works, but since notebooks don't have a way of declaring dependencies this is almost certainly going to fail on most notebooks
View Dockerfile
FROM python:3
RUN pip install papermill ipykernel
VOLUME /tmp/workdir
WORKDIR /tmp/workdir
ENTRYPOINT ["papermill"]
@WheresAlice
WheresAlice / Makefile
Created Sep 7, 2018
Locally validate a directory of Prometheus rules against version 1.7.1
View Makefile
.PHONY: test
test:
docker run -it --rm -v `pwd`:/tmp -w /tmp --entrypoint=/bin/promtool prom/prometheus:v1.7.1 check-rules *.rules
View main.go
package main
import (
"github.com/Jeffail/benthos/lib/stream"
"github.com/Jeffail/benthos/lib/input"
"github.com/Jeffail/benthos/lib/output"
"github.com/Jeffail/benthos/lib/types"
"time"
"os"
"os/signal"
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.pem with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:8443
import BaseHTTPServer, SimpleHTTPServer
import ssl
You can’t perform that action at this time.