Skip to content

Instantly share code, notes, and snippets.

@robsquires
robsquires / git-cheatsheet.md
Last active April 5, 2024 19:58
Git cheatsheet

Pulling and Pushing your branch

When pulling or pushing your branch there are 4 states you may find yourself in:

  1. Behind Github - Github has all the commits on your working copy of the branch, plus some extras. When you are updating your copy of main, it will always be this state. A feature branch may be in this state if you've been pairing

  2. Ahead of Github - your branch has all the commits that Github has, plus some extras. Your feature branch will be in this state most of the time

@robsquires
robsquires / bubbles-data.md
Last active May 1, 2020 08:40
Outlines what data is currently used by the bubbles

From Myft API follows data

Returns array of concepts:

[
    {
        conceptId,
        conceptName
 },
@robsquires
robsquires / prepare-commit-msg
Last active September 14, 2017 16:23
Pre populate the jira prefix on commit messages
# abort if .git-hooks is not present
# add .git-hooks to .git-ignore so people can opt-in
if [ ! -f .git-hooks ]; then
exit 0
fi
# some commit operations we dont want to prefix the message
if [[ "$2" == "merge" || "$2" == "commit" || "$2" == "template" || "$2" == "squash" ]]; then
echo "Not a regular commit so ignoring.."
exit 0
@robsquires
robsquires / pre-commit
Created April 8, 2016 12:40
Run jshint on git commit
#!/bin/sh
# You'll need Jshint available, perhaps 'npm install -g jshint'
files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.js$")
if [ "$files" = "" ]; then
exit 0
fi
pass=true

Media Asset Pages powered by a PID should be playable

Given I'm on a media asset page powered by a PID
 When I press play on the video
 Then the video should play

has now become..

Videos authored by UK journalists through system X should be playable on media asset pages

Scenario: Student can search for a user
Given I am viewing the user list
And I have entered the search term "cwl15"
When I press search
Then I will see the following search results:
| cwl15 |
@javascript
Scenario: Student will be suggested search terms to help speed up their search
Given I am viewing the user list
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEDIT/TEXTWRANGLER REGULAR EXPRESSION GUIDE MODIFIED 2014-01-13 : 00:12
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@robsquires
robsquires / set-auth-cookie.php
Created December 10, 2013 09:52
set cookie (maybe for authentication) when using WebApiDriver
@robsquires
robsquires / selenium treats
Created September 6, 2013 01:03
code snippets to aid error diagnosis when using phantomjs
catching uncaught JS errors
//put this in your <head>
<script type="text/javascript" >
window.jsErrors = [];
window.onerror = function() {
window.jsErrors[window.jsErrors.length] = arguments;
}
</script>