Skip to content

Instantly share code, notes, and snippets.

@TheMightyLlama
TheMightyLlama / gist:106ad6c8bdfbd740c496
Last active August 29, 2015 14:06
download-smartling-files.sh
#!/bin/bash
#Dependencies
#Parallel with Homebrew: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/parallel.rb
#Usage:
#./download-smartling-files.sh <file_type> <api_key> <project_id>
shopt -s nullglob
@TheMightyLlama
TheMightyLlama / gist:7e300149a901c3ee5642
Last active August 29, 2015 14:11
Get Release Branch Dates
function getReleases(){
git fetch &>/dev/null;
git checkout develop &>/dev/null;
git pull &>/dev/null;
for k in $(git branch|sed s/^..//);
do
#$k is release name
if [[ $k == *release* || $k == *hotfix* ]]; then
@TheMightyLlama
TheMightyLlama / Login.feature
Last active August 29, 2015 14:14
Login Sample
Feature: Login
Login can be performed with validated email
User stays on login page with wrong username/pass
Scenario: Correct Email Pass Combo
Given User Exists
And User has <email>
And User has <password>
When User attempts to login
Then they are given access to the service
@TheMightyLlama
TheMightyLlama / gist:261b296d66b3a042b743
Last active August 29, 2015 14:17
print a string and status with correct number of periods
function printStatus () {
string=$1;
status=$2;
lineLength=`tput cols`;
stringLength=${#string};
statusLength=${#status};
periodLength=$((lineLength - stringLength - statusLength));
All Asia Asset Cptl AAA
Albemarle & Bond Hldgs ABM
Aberdeen Asset Mngmnt ADN
ADVFN AFN
Alecto Minerals ALO
Amphion Innovations AMP
Africa Oilfield AOL
Alpha Strategic APS
Arbuthnot Banking ARBB
Arden Partners ARDN
For proper splitting of objects see here: http://stackoverflow.com/questions/7460934/best-practices-in-retrieving-related-data-in-a-rest-api
For faking data: https://github.com/marak/Faker.js/
JSON Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Account Data",
"description": "All information pertaining to a single account",
"type": "object",
"properties": {
%YAML 1.2
---
name: Plain Text
file_extensions: [txt]
scope: source.c
contexts:
main:
- match: \b(Attendee|agenda|item|TITLE|DATE|OWNER|ATTENDEES|AGENDA|ACTIONS|NOTES|RISKS)\b
{
"designations" : [
{"name":"The Andromeda Galaxy"},
{"name":"M31"},
{"name":"NGC224"},
{"name":"UGC454"}
],
"observationEpoch" : "J2000",
"pronunciation" : "/ænˈdrɒmᵻdə/",
"constellation" : "Andromeda",
Feature: A Client can GET a SECTOR resource
As a Client
I want to get a sector
So that I can evaluate what needs to be modified
Background:
Given the system knows about the following sector:
| sector id | sector name | sector url |
| 1 | Oil & Gas | http://www.iii.co.uk/investment/detail?code=cotn:NMX0530.L&display=sector |
And the client creates a new SECTOR request