Skip to content

Instantly share code, notes, and snippets.

View danpoltawski's full-sized avatar

Dan Poltawski danpoltawski

View GitHub Profile
Running 4 parallel behat sites:
[behatrun1] vendor/bin/behat --config /var/www/moodledata/behat/behatrun1/behat/behat.yml
[behatrun2] vendor/bin/behat --config /var/www/moodledata/behat/behatrun2/behat/behat.yml
[behatrun3] vendor/bin/behat --config /var/www/moodledata/behat/behatrun3/behat/behat.yml
[behatrun4] vendor/bin/behat --config /var/www/moodledata/behat/behatrun4/behat/behat.yml
Moodle 3.4dev (Build: 20170622), b095b36c02bbbf2806e5dfa493cc272b1ec740e7
Php: 7.1.6, pgsql: 9.6.3, OS: Linux 4.4.0-81-generic x86_64
Server OS "Linux", Browser: "chrome"
Browser specific fixes have been applied. See http://docs.moodle.org/dev/Acceptance_testing#Browser_specific_fixes
Started at 07-07-2017, 19:22
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var driver = new webdriver.Builder()
.forBrowser('safari')
.usingServer('http://localhost:4444/')
.build();
driver.get('http://localhost/im');
@danpoltawski
danpoltawski / gist:cebd6c767d6781cad35a0e5fac4bc653
Last active April 4, 2017 07:50
rewrite commit messages in large branch
git filter-branch --msg-filter \
'sed "s/Part of MDL-55611./Part of MDL-55611 epic./"' \
HEAD...origin/master
#!/bin/bash
STARTDAY=20160102
echo "Week beginning, fileschanged, insertions, deletion"
for i in $(seq 0 44); do
from=$(date +%Y-%m-%d --date $STARTDAY+${i}weeks)
j=$(($i+1))
to=$(date +%Y-%m-%d --date $STARTDAY+${j}weeks)
fromcommit=$(git rev-list -n 1 --before=$from master)
@danpoltawski
danpoltawski / gist:32ce34b9c0829277c29deac1a9ad0cb5
Last active October 6, 2016 15:17
wip mustache linter utput
Errors first:
ERROR: /admin/tool/lp/templates/course_competency_statistics.mustache - Example context JSON is unparsable, fails with: Syntax error
ERROR: /admin/tool/lp/templates/plan_page.mustache - Illegal content in < parent tag
ERROR: /admin/tool/lp/templates/progress_bar.mustache - Unexpected closing tag: /progresstext on line 5
ERROR: /admin/tool/lp/templates/template_statistics.mustache - Example context JSON is unparsable, fails with: Syntax error
ERROR: /blocks/rss_client/templates/feed.mustache - Unexpected closing tag: /image on line 6
ERROR: /blocks/rss_client/templates/item.mustache - Unexpected closing tag: /title on line 7
ERROR: /lib/templates/columns-1to1to1.mustache - Unexpected closing tag: /column1 on line 3
ERROR: /lib/templates/columns-1to2.mustache - Unexpected closing tag: /column1 on line 3
ERROR: /lib/templates/columns-2to1.mustache - Unexpected closing tag: /column1 on line 3
@danpoltawski
danpoltawski / gist:413797e9fdaa8671da8f3e8d66bc4d42
Created September 7, 2016 10:19
moodle.Files.MoodleInternal
$ phpcs \
--standard=/Users/danp/www/ci/local/codechecker/moodle/ruleset.xml --sniffs="moodle.Files.MoodleInternal" --report=csv . \
| cut -d ',' -f1 | sed -e 's/"//g' | tail -n +2 | xargs grep 'MOODLE_INTERNAL'
admin/cli/install.php:define('MOODLE_INTERNAL', true);
admin/tool/log/classes/plugininfo/logstore.php:defined('MOODLE_INTERNAL') || die();
competency/classes/external/comment_area_exporter.php:defined('MOODLE_INTERNAL') || die();
dataformat/csv/classes/writer.php:defined('MOODLE_INTERNAL') || die();
dataformat/excel/classes/writer.php:defined('MOODLE_INTERNAL') || die();
dataformat/ods/classes/writer.php:defined('MOODLE_INTERNAL') || die();
@danpoltawski
danpoltawski / test-three-download-speed.sh
Last active September 5, 2016 18:43
Comparing the download speed for an image on facebook vs twitter cdn on Three's feel@home
#!/usr/bin/env bash
# compare the speed of downloading a file from twitter and facebook cnd
echo 'facebook,twitter'
for run in {1..20}
do
# Unfortunately these files aren't exactly the exact same bits, but each service does its own thing on uploads, so wasn't
# able to get a checksum matching file.
curl -s -o /dev/null -w '%{time_total},' https://scontent-lhr3-1.xx.fbcdn.net/t31.0-8/14195317_10153968112506376_6523509013734043542_o.jpg
curl -s -o /dev/null -w '%{time_total}\n' https://pbs.twimg.com/media/CrhF35RXgAEoSb0.jpg
$ find * -type f -not -path 'tests/*' ! -exec git grep -lq {} tests/ \; -print
check_upgrade_savepoints/check_upgrade_savepoints.php
coding_standards_detector/coding_standards_detector.php
compare_databases/compare_databases.php
compare_databases/compare_databases.sh
compare_databases/run_conditionally.sh
generate_component_ant_files/generate_component_ant_files.php
git_garbage_collector/git_garbage_collector.sh
index.html
initial_jenkins_moodle_setup/initial_jenkins_moodle_setup.sh
@danpoltawski
danpoltawski / Gruntfile-stylelint-postcss.patcn
Created July 8, 2016 15:48
grunt-postcss for styleline with css (no longer relevant)
From 859664035feb4ac0df018489517bdaf984dbb9fd Mon Sep 17 00:00:00 2001
From: Dan Poltawski <dan@moodle.com>
Date: Tue, 5 Jul 2016 15:56:53 +0100
Subject: [PATCH 1/1] MDL-55058 grunt: add stylelint css linting
---
Gruntfile.js | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/Gruntfile.js b/Gruntfile.js

Eslint results on 3671ebed151

Core AMD modules

✘ 248 problems (0 errors, 248 warnings)

$ eslint --format 'node_modules/eslint-friendly-formatter' */**/amd/src/*