Skip to content

Instantly share code, notes, and snippets.

// input
// [
// 'pref-001|choice-001',
// 'pref-001|choice-002',
// 'pref-002|choice-001',
// ]
// output
// [
# ----------------------------------------
# configuration
# ----------------------------------------
# fix tmux/vim colour issues
set -g default-terminal "screen-256color"
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
1) still requests the territory from API if stored territory is '--'
     @service territoryGatekeeper .init() when getting the territory from local storage
     Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Scenario: Un-disliking an on-demand track sends an undislike event # test/acceptance/features/scrobbling_analytics.feature:150
    Given I am logged in with an unlimited subscription              # test/acceptance/features/step_definitions/account.rb:9
@danscotton
danscotton / gist:73ba4814228acc8407b0
Last active August 29, 2015 14:23
debug output 'displaying the current mix'
Feature: Player metadata
In order to know what track is currently playing
As a user
I want to see metadata in the player
Background: # test/rake/features/player_metadata.feature:6
Given the following data exists in EAPI # test/rake/features/step_definitions/mixes.rb:5
| Category | Group | Mix | Track | Artist |
| Themes | Fitness | Gym workout | Track A | Artist A |
| | | | Track B | Artist B |
@danscotton
danscotton / actions.js
Created May 28, 2015 14:47
Version B: Separate files for Actions and Events
'use strict';
var events = require('./events');
module.exports = {
display: function ( notice ) {
this.dispatch( events.DISPLAY, notice );
},
dismiss: function ( noticeId ) {
@danscotton
danscotton / 1_mixes.feature
Last active August 29, 2015 14:20
Monday Code Challenge: Transform data tables
Background:
Given the following mixes data
| 1 | Metal | Heavy metal | Track A |
| | | | Track B |
| | | | Track C |
| | | Hair metal | Track D |
| | | | Track E |
| | | | Track F |
| 2 | Dance | House | Track G |
| | | | Track H |
define(['module/bootstrap'], function(news) {
var $ = news.$;
function seconds(secs) {
return secs * 1000;
}
function double(num) {
return num * 2;
}
// This file is responsible for actually creating the objects, and kicking things off.
// We create a simple object with a run method (which Poller expects) that when called,
// calls checker.check().
define('MyApp', ['Poller, StatusChecker'], function(Poller, StatusChecker) {
var checker = new StatusChecker({ url: 'http://localhost:3000/foobar', limit: 5000 }),
poller = new Poller({
run: function() {
return checker.check(function(status) {
if (status == 200) {
return true;
# - I've assumed you've separated the items into two arrays
# because you want to select those items at some point later.
# I've refactored to 'filter' the items on the way out, rather
# than filtering them on the way in.
# - Also added a :type method rather than class checking.
# - You could even use Set instead of [] here
class Foo
def initialize(initial_items = [])
@items = initial_items
<?php
class MyClassTest extends PHPUnit_Framework_TestCase
{
public function setup()
{
$this->dependency = Phake::mock('Dependency');
$this->myClass = new MyClassOne($this->dependency);
}