Fixed wrong opcodes for some instructions.

--- src/CPU.coffee
+++ src/CPU.coffee
@@ -693,255 +693,255 @@
         # No operation instruction
         ###########################################################

-        @registerOperation 0xEA, @NOP, @impliedMode, no, no
+        @registerOperation 0xEA, @NOP, @impliedMode, no, no # 2 cycles

         ###########################################################
         # Clear flag instructions
         ###########################################################

-        @registerOperation 0x18, @CLC, @impliedMode, no, no
-        @registerOperation 0x58, @CLI, @impliedMode, no, no
-        @registerOperation 0xD8, @CLD, @impliedMode, no, no
-        @registerOperation 0xB8, @CLV, @impliedMode, no, no
+        @registerOperation 0x18, @CLC, @impliedMode, no, no # 2 cycles
+        @registerOperation 0x58, @CLI, @impliedMode, no, no # 2 cycles
+        @registerOperation 0xD8, @CLD, @impliedMode, no, no # 2 cycles
+        @registerOperation 0xB8, @CLV, @impliedMode, no, no # 2 cycles

         ###########################################################
         # Set flag instructions
         ###########################################################

-        @registerOperation 0x38, @SEC, @impliedMode, no, no
-        @registerOperation 0x78, @SEI, @impliedMode, no, no
-        @registerOperation 0xF8, @SED, @impliedMode, no, no
+        @registerOperation 0x38, @SEC, @impliedMode, no, no # 2 cycles
+        @registerOperation 0x78, @SEI, @impliedMode, no, no # 2 cycles
+        @registerOperation 0xF8, @SED, @impliedMode, no, no # 2 cycles

         ###########################################################
         # Memory write instructions
         ###########################################################

-        @registerOperation 0x85, @STA, @zeroPageMode,  no,  no
-        @registerOperation 0x95, @STA, @zeroPageXMode, no,  no
-        @registerOperation 0x8D, @STA, @absoluteMode,  no,  no
-        @registerOperation 0x9D, @STA, @absoluteXMode, yes, no
-        @registerOperation 0x99, @STA, @absoluteYMode, yes, no
-        @registerOperation 0x81, @STA, @indirectXMode, no,  no
-        @registerOperation 0x91, @STA, @indirectYMode, yes, no
-
-        @registerOperation 0x86, @STX, @zeroPageMode,  no,  no
-        @registerOperation 0x96, @STX, @zeroPageYMode, no,  no
-        @registerOperation 0x8E, @STX, @absoluteMode,  no,  no
-
-        @registerOperation 0x84, @STY, @zeroPageMode,  no,  no
-        @registerOperation 0x94, @STY, @zeroPageXMode, no,  no
-        @registerOperation 0x8C, @STY, @absoluteMode,  no,  no
+        @registerOperation 0x85, @STA, @zeroPageMode,  no,  no # 3 cycles
+        @registerOperation 0x95, @STA, @zeroPageXMode, no,  no # 4 cycles
+        @registerOperation 0x8D, @STA, @absoluteMode,  no,  no # 4 cycles
+        @registerOperation 0x9D, @STA, @absoluteXMode, yes, no # 5 cycles
+        @registerOperation 0x99, @STA, @absoluteYMode, yes, no # 5 cycles
+        @registerOperation 0x81, @STA, @indirectXMode, no,  no # 6 cycles
+        @registerOperation 0x91, @STA, @indirectYMode, yes, no # 6 cycles
+
+        @registerOperation 0x86, @STX, @zeroPageMode,  no,  no # 3 cycles
+        @registerOperation 0x96, @STX, @zeroPageYMode, no,  no # 4 cycles
+        @registerOperation 0x8E, @STX, @absoluteMode,  no,  no # 4 cycles
+
+        @registerOperation 0x84, @STY, @zeroPageMode,  no,  no # 3 cycles
+        @registerOperation 0x94, @STY, @zeroPageXMode, no,  no # 4 cycles
+        @registerOperation 0x8C, @STY, @absoluteMode,  no,  no # 4 cycles

         ###########################################################
         # Memory read instructions
         ###########################################################

-        @registerOperation 0xA9, @LDA, @immediateMode, no, no
-        @registerOperation 0xA5, @LDA, @zeroPageMode,  no, no
-        @registerOperation 0xB5, @LDA, @zeroPageXMode, no, no
-        @registerOperation 0xAD, @LDA, @absoluteMode,  no, no
-        @registerOperation 0xBD, @LDA, @absoluteXMode, no, no
-        @registerOperation 0xB9, @LDA, @absoluteYMode, no, no
-        @registerOperation 0xA1, @LDA, @indirectXMode, no, no
-        @registerOperation 0xB1, @LDA, @indirectYMode, no, no
-
-        @registerOperation 0xA9, @LDX, @immediateMode, no, no
-        @registerOperation 0xA5, @LDX, @zeroPageMode,  no, no
-        @registerOperation 0xB5, @LDX, @zeroPageYMode, no, no
-        @registerOperation 0xAD, @LDX, @absoluteMode,  no, no
-        @registerOperation 0xBD, @LDX, @absoluteYMode, no, no
-
-        @registerOperation 0xA9, @LDY, @immediateMode, no, no
-        @registerOperation 0xA5, @LDY, @zeroPageMode,  no, no
-        @registerOperation 0xB5, @LDY, @zeroPageXMode, no, no
-        @registerOperation 0xAD, @LDY, @absoluteMode,  no, no
-        @registerOperation 0xBD, @LDY, @absoluteXMode, no, no
+        @registerOperation 0xA9, @LDA, @immediateMode, no, no # 2      cycles
+        @registerOperation 0xA5, @LDA, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0xB5, @LDA, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0xAD, @LDA, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0xBD, @LDA, @absoluteXMode, no, no # 4 (+1) cycles
+        @registerOperation 0xB9, @LDA, @absoluteYMode, no, no # 4 (+1) cycles
+        @registerOperation 0xA1, @LDA, @indirectXMode, no, no # 6      cycles
+        @registerOperation 0xB1, @LDA, @indirectYMode, no, no # 5 (+1) cycles
+
+        @registerOperation 0xA2, @LDX, @immediateMode, no, no # 2      cycles
+        @registerOperation 0xA6, @LDX, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0xB6, @LDX, @zeroPageYMode, no, no # 4      cycles
+        @registerOperation 0xAE, @LDX, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0xBE, @LDX, @absoluteYMode, no, no # 4 (+1) cycles
+
+        @registerOperation 0xA0, @LDY, @immediateMode, no, no # 2      cycles
+        @registerOperation 0xA4, @LDY, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0xB4, @LDY, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0xAC, @LDY, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0xBC, @LDY, @absoluteXMode, no, no # 4 (+1) cycles

         ###########################################################
         # Register transfer instructions
         ###########################################################

-        @registerOperation 0xAA, @TAX, @impliedMode, no, no
-        @registerOperation 0xA8, @TAY, @impliedMode, no, no
-        @registerOperation 0x8A, @TXA, @impliedMode, no, no
-        @registerOperation 0x98, @TYA, @impliedMode, no, no
-        @registerOperation 0x9A, @TXS, @impliedMode, no, no
-        @registerOperation 0xBA, @TSX, @impliedMode, no, no
+        @registerOperation 0xAA, @TAX, @impliedMode, no, no # 2 cycles
+        @registerOperation 0xA8, @TAY, @impliedMode, no, no # 2 cycles
+        @registerOperation 0x8A, @TXA, @impliedMode, no, no # 2 cycles
+        @registerOperation 0x98, @TYA, @impliedMode, no, no # 2 cycles
+        @registerOperation 0x9A, @TXS, @impliedMode, no, no # 2 cycles
+        @registerOperation 0xBA, @TSX, @impliedMode, no, no # 2 cycles

         ###########################################################
         # Stack push instructions
         ###########################################################

-        @registerOperation 0x48, @PHA, @impliedMode, no, no
-        @registerOperation 0x08, @PHP, @impliedMode, no, no
+        @registerOperation 0x48, @PHA, @impliedMode, no, no # 3 cycles
+        @registerOperation 0x08, @PHP, @impliedMode, no, no # 3 cycles

         ###########################################################
         # Stack pull instructions
         ###########################################################

-        @registerOperation 0x68, @PLA, @impliedMode, no, no
-        @registerOperation 0x28, @PLP, @impliedMode, no, no
+        @registerOperation 0x68, @PLA, @impliedMode, no, no # 4 cycles
+        @registerOperation 0x28, @PLP, @impliedMode, no, no # 4 cycles

         ###########################################################
         # Accumulator bitwise instructions
         ###########################################################

-        @registerOperation 0x29, @AND, @immediateMode, no, no
-        @registerOperation 0x25, @AND, @zeroPageMode,  no, no
-        @registerOperation 0x35, @AND, @zeroPageXMode, no, no
-        @registerOperation 0x2D, @AND, @absoluteMode,  no, no
-        @registerOperation 0x3D, @AND, @absoluteXMode, no, no
-        @registerOperation 0x39, @AND, @absoluteYMode, no, no
-        @registerOperation 0x21, @AND, @indirectXMode, no, no
-        @registerOperation 0x31, @AND, @indirectYMode, no, no
-
-        @registerOperation 0x49, @EOR, @immediateMode, no, no
-        @registerOperation 0x45, @EOR, @zeroPageMode,  no, no
-        @registerOperation 0x55, @EOR, @zeroPageXMode, no, no
-        @registerOperation 0x4D, @EOR, @absoluteMode,  no, no
-        @registerOperation 0x5D, @EOR, @absoluteXMode, no, no
-        @registerOperation 0x59, @EOR, @absoluteYMode, no, no
-        @registerOperation 0x41, @EOR, @indirectXMode, no, no
-        @registerOperation 0x51, @EOR, @indirectYMode, no, no
-
-        @registerOperation 0x09, @ORA, @immediateMode, no, no
-        @registerOperation 0x05, @ORA, @zeroPageMode,  no, no
-        @registerOperation 0x15, @ORA, @zeroPageXMode, no, no
-        @registerOperation 0x0D, @ORA, @absoluteMode,  no, no
-        @registerOperation 0x1D, @ORA, @absoluteXMode, no, no
-        @registerOperation 0x19, @ORA, @absoluteYMode, no, no
-        @registerOperation 0x01, @ORA, @indirectXMode, no, no
-        @registerOperation 0x11, @ORA, @indirectYMode, no, no
-
-        @registerOperation 0x24, @BIT, @zeroPageMode,  no, no
-        @registerOperation 0x2C, @BIT, @absoluteMode,  no, no
+        @registerOperation 0x29, @AND, @immediateMode, no, no # 2      cycles
+        @registerOperation 0x25, @AND, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0x35, @AND, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0x2D, @AND, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0x3D, @AND, @absoluteXMode, no, no # 4 (+1) cycles
+        @registerOperation 0x39, @AND, @absoluteYMode, no, no # 4 (+1) cycles
+        @registerOperation 0x21, @AND, @indirectXMode, no, no # 6      cycles
+        @registerOperation 0x31, @AND, @indirectYMode, no, no # 5 (+1) cycles
+
+        @registerOperation 0x09, @ORA, @immediateMode, no, no # 2      cycles
+        @registerOperation 0x05, @ORA, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0x15, @ORA, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0x0D, @ORA, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0x1D, @ORA, @absoluteXMode, no, no # 4 (+1) cycles
+        @registerOperation 0x19, @ORA, @absoluteYMode, no, no # 4 (+1) cycles
+        @registerOperation 0x01, @ORA, @indirectXMode, no, no # 6      cycles
+        @registerOperation 0x11, @ORA, @indirectYMode, no, no # 5 (+1) cycles
+
+        @registerOperation 0x49, @EOR, @immediateMode, no, no # 2      cycles
+        @registerOperation 0x45, @EOR, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0x55, @EOR, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0x4D, @EOR, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0x5D, @EOR, @absoluteXMode, no, no # 4 (+1) cycles
+        @registerOperation 0x59, @EOR, @absoluteYMode, no, no # 4 (+1) cycles
+        @registerOperation 0x41, @EOR, @indirectXMode, no, no # 6      cycles
+        @registerOperation 0x51, @EOR, @indirectYMode, no, no # 5 (+1) cycles
+
+        @registerOperation 0x24, @BIT, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0x2C, @BIT, @absoluteMode,  no, no # 4      cycles

         ###########################################################
         # Increment instructions
         ###########################################################

-        @registerOperation 0xC6, @INC, @zeroPageMode,  no,  yes
-        @registerOperation 0xD6, @INC, @zeroPageXMode, no,  yes
-        @registerOperation 0xCE, @INC, @absoluteMode,  no,  yes
-        @registerOperation 0xDE, @INC, @absoluteXMode, yes, yes
-
-        @registerOperation 0xCA, @INX, @impliedMode,   no,  no
-        @registerOperation 0x88, @INY, @impliedMode,   no,  no
+        @registerOperation 0xE6, @INC, @zeroPageMode,  no,  yes # 5 cycles
+        @registerOperation 0xF6, @INC, @zeroPageXMode, no,  yes # 6 cycles
+        @registerOperation 0xEE, @INC, @absoluteMode,  no,  yes # 6 cycles
+        @registerOperation 0xFE, @INC, @absoluteXMode, yes, yes # 7 cycles
+
+        @registerOperation 0xE8, @INX, @impliedMode,   no,  no  # 2 cycles
+        @registerOperation 0xC8, @INY, @impliedMode,   no,  no  # 2 cycles

         ###########################################################
         # Decrement instructions
         ###########################################################

-        @registerOperation 0xC6, @DEC, @zeroPageMode,  no,  yes
-        @registerOperation 0xD6, @DEC, @zeroPageXMode, no,  yes
-        @registerOperation 0xCE, @DEC, @absoluteMode,  no,  yes
-        @registerOperation 0xDE, @DEC, @absoluteXMode, yes, yes
-
-        @registerOperation 0xCA, @DEX, @impliedMode,   no,  no
-        @registerOperation 0x88, @DEY, @impliedMode,   no,  no
+        @registerOperation 0xC6, @DEC, @zeroPageMode,  no,  yes # 5 cycles
+        @registerOperation 0xD6, @DEC, @zeroPageXMode, no,  yes # 6 cycles
+        @registerOperation 0xCE, @DEC, @absoluteMode,  no,  yes # 6 cycles
+        @registerOperation 0xDE, @DEC, @absoluteXMode, yes, yes # 7 cycles
+
+        @registerOperation 0xCA, @DEX, @impliedMode,   no,  no  #  cycles
+        @registerOperation 0x88, @DEY, @impliedMode,   no,  no  #  cycles

         ###########################################################
         # Comparison instructions
         ###########################################################

-        @registerOperation 0xC9, @CMP, @immediateMode, no, no
-        @registerOperation 0xC5, @CMP, @zeroPageMode,  no, no
-        @registerOperation 0xD5, @CMP, @zeroPageXMode, no, no
-        @registerOperation 0xCD, @CMP, @absoluteMode,  no, no
-        @registerOperation 0xDD, @CMP, @absoluteXMode, no, no
-        @registerOperation 0xD9, @CMP, @absoluteYMode, no, no
-        @registerOperation 0xC1, @CMP, @indirectXMode, no, no
-        @registerOperation 0xD1, @CMP, @indirectYMode, no, no
-
-        @registerOperation 0xE0, @CPX, @immediateMode, no, no
-        @registerOperation 0xE4, @CPX, @zeroPageMode,  no, no
-        @registerOperation 0xEC, @CPX, @absoluteMode,  no, no
-
-        @registerOperation 0xC0, @CPY, @immediateMode, no, no
-        @registerOperation 0xC4, @CPY, @zeroPageMode,  no, no
-        @registerOperation 0xCC, @CPY, @absoluteMode,  no, no
+        @registerOperation 0xC9, @CMP, @immediateMode, no, no # 2      cycles
+        @registerOperation 0xC5, @CMP, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0xD5, @CMP, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0xCD, @CMP, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0xDD, @CMP, @absoluteXMode, no, no # 4 (+1) cycles
+        @registerOperation 0xD9, @CMP, @absoluteYMode, no, no # 4 (+1) cycles
+        @registerOperation 0xC1, @CMP, @indirectXMode, no, no # 6      cycles
+        @registerOperation 0xD1, @CMP, @indirectYMode, no, no # 5 (+1) cycles
+
+        @registerOperation 0xE0, @CPX, @immediateMode, no, no # 2      cycles
+        @registerOperation 0xE4, @CPX, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0xEC, @CPX, @absoluteMode,  no, no # 4      cycles
+
+        @registerOperation 0xC0, @CPY, @immediateMode, no, no # 2      cycles
+        @registerOperation 0xC4, @CPY, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0xCC, @CPY, @absoluteMode,  no, no # 4      cycles

         ###########################################################
         # Branching instructions
         ###########################################################

-        @registerOperation 0x90, @BCC, @relativeMode, no, no
-        @registerOperation 0xB0, @BCS, @relativeMode, no, no
-
-        @registerOperation 0xD0, @BNE, @relativeMode, no, no
-        @registerOperation 0xB0, @BEQ, @relativeMode, no, no
+        @registerOperation 0x90, @BCC, @relativeMode, no, no # 2 (+1/+2) cycles
+        @registerOperation 0xB0, @BCS, @relativeMode, no, no # 2 (+1/+2) cycles
+
+        @registerOperation 0xD0, @BNE, @relativeMode, no, no # 2 (+1/+2) cycles
+        @registerOperation 0xF0, @BEQ, @relativeMode, no, no # 2 (+1/+2) cycles

-        @registerOperation 0x50, @BVC, @relativeMode, no, no
-        @registerOperation 0x70, @BVS, @relativeMode, no, no
-
-        @registerOperation 0x30, @BMI, @relativeMode, no, no
-        @registerOperation 0x10, @BPL, @relativeMode, no, no
+        @registerOperation 0x50, @BVC, @relativeMode, no, no # 2 (+1/+2) cycles
+        @registerOperation 0x70, @BVS, @relativeMode, no, no # 2 (+1/+2) cycles
+
+        @registerOperation 0x30, @BMI, @relativeMode, no, no # 2 (+1/+2) cycles
+        @registerOperation 0x10, @BPL, @relativeMode, no, no # 2 (+1/+2) cycles

         ###########################################################
         # Jump / subroutine instructions
         ###########################################################

-        @registerOperation 0x4C, @JMP, @absoluteMode, no, no
-        @registerOperation 0x6C, @JMP, @indirectMode, no, no
-        @registerOperation 0x20, @JSR, @absoluteMode, no, no
-        @registerOperation 0x60, @RTS, @impliedMode,  no, no
+        @registerOperation 0x4C, @JMP, @absoluteMode, no, no # 3 cycles
+        @registerOperation 0x6C, @JMP, @indirectMode, no, no # 5 cycles
+        @registerOperation 0x20, @JSR, @absoluteMode, no, no # 6 cycles
+        @registerOperation 0x60, @RTS, @impliedMode,  no, no # 6 cycles

         ###########################################################
         # Interrupt control instructions
         ###########################################################

-        @registerOperation 0x00, @BRK, @impliedMode, no, no
-        @registerOperation 0x40, @RTI, @impliedMode, no, no
+        @registerOperation 0x00, @BRK, @impliedMode, no, no # 7 cycles
+        @registerOperation 0x40, @RTI, @impliedMode, no, no # 6 cycles

         ###########################################################
         # Addition / subtraction instructions
         ###########################################################

-        @registerOperation 0x69, @ADC, @immediateMode, no, no
-        @registerOperation 0x65, @ADC, @zeroPageMode,  no, no
-        @registerOperation 0x75, @ADC, @zeroPageXMode, no, no
-        @registerOperation 0x6D, @ADC, @absoluteMode,  no, no
-        @registerOperation 0x7D, @ADC, @absoluteXMode, no, no
-        @registerOperation 0x79, @ADC, @absoluteYMode, no, no
-        @registerOperation 0x61, @ADC, @indirectXMode, no, no
-        @registerOperation 0x71, @ADC, @indirectYMode, no, no
-
-        @registerOperation 0xE9, @SBC, @immediateMode, no, no
-        @registerOperation 0xE5, @SBC, @zeroPageMode,  no, no
-        @registerOperation 0xF5, @SBC, @zeroPageXMode, no, no
-        @registerOperation 0xED, @SBC, @absoluteMode,  no, no
-        @registerOperation 0xFD, @SBC, @absoluteXMode, no, no
-        @registerOperation 0xF9, @SBC, @absoluteYMode, no, no
-        @registerOperation 0xE1, @SBC, @indirectXMode, no, no
-        @registerOperation 0xF1, @SBC, @indirectYMode, no, no
+        @registerOperation 0x69, @ADC, @immediateMode, no, no # 2      cycles
+        @registerOperation 0x65, @ADC, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0x75, @ADC, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0x6D, @ADC, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0x7D, @ADC, @absoluteXMode, no, no # 4 (+1) cycles
+        @registerOperation 0x79, @ADC, @absoluteYMode, no, no # 4 (+1) cycles
+        @registerOperation 0x61, @ADC, @indirectXMode, no, no # 6      cycles
+        @registerOperation 0x71, @ADC, @indirectYMode, no, no # 5 (+1) cycles
+
+        @registerOperation 0xE9, @SBC, @immediateMode, no, no # 2      cycles
+        @registerOperation 0xE5, @SBC, @zeroPageMode,  no, no # 3      cycles
+        @registerOperation 0xF5, @SBC, @zeroPageXMode, no, no # 4      cycles
+        @registerOperation 0xED, @SBC, @absoluteMode,  no, no # 4      cycles
+        @registerOperation 0xFD, @SBC, @absoluteXMode, no, no # 4 (+1) cycles
+        @registerOperation 0xF9, @SBC, @absoluteYMode, no, no # 4 (+1) cycles
+        @registerOperation 0xE1, @SBC, @indirectXMode, no, no # 6      cycles
+        @registerOperation 0xF1, @SBC, @indirectYMode, no, no # 5 (+1) cycles

         ###########################################################
         # Shifting instructions
         ###########################################################

-        @registerOperation 0x0A, @ASL, @accumulatorMode, no,  no
-        @registerOperation 0x06, @ASL, @zeroPageMode,    no,  yes
-        @registerOperation 0x16, @ASL, @zeroPageXMode,   no,  yes
-        @registerOperation 0x0E, @ASL, @absoluteMode,    no,  yes
-        @registerOperation 0x1E, @ASL, @absoluteXMode,   yes, yes
-
-        @registerOperation 0xA9, @LSR, @accumulatorMode, no,  no
-        @registerOperation 0xA5, @LSR, @zeroPageMode,    no,  yes
-        @registerOperation 0xB5, @LSR, @zeroPageXMode,   no,  yes
-        @registerOperation 0xAD, @LSR, @absoluteMode,    no,  yes
-        @registerOperation 0xBD, @LSR, @absoluteXMode,   yes, yes
-
-        @registerOperation 0x2A, @ROL, @accumulatorMode, no,  no
-        @registerOperation 0x26, @ROL, @zeroPageMode,    no,  yes
-        @registerOperation 0x36, @ROL, @zeroPageXMode,   no,  yes
-        @registerOperation 0x2E, @ROL, @absoluteMode,    no,  yes
-        @registerOperation 0x3E, @ROL, @absoluteXMode,   yes, yes
-
-        @registerOperation 0x6A, @ROR, @accumulatorMode, no,  no
-        @registerOperation 0x66, @ROR, @zeroPageMode,    no,  yes
-        @registerOperation 0x76, @ROR, @zeroPageXMode,   no,  yes
-        @registerOperation 0x6E, @ROR, @absoluteMode,    no,  yes
-        @registerOperation 0x7E, @ROR, @absoluteXMode,   yes, yes
+        @registerOperation 0x0A, @ASL, @accumulatorMode, no,  no  # 2 cycles
+        @registerOperation 0x06, @ASL, @zeroPageMode,    no,  yes # 5 cycles
+        @registerOperation 0x16, @ASL, @zeroPageXMode,   no,  yes # 6 cycles
+        @registerOperation 0x0E, @ASL, @absoluteMode,    no,  yes # 6 cycles
+        @registerOperation 0x1E, @ASL, @absoluteXMode,   yes, yes # 7 cycles
+
+        @registerOperation 0x4A, @LSR, @accumulatorMode, no,  no  # 2 cycles
+        @registerOperation 0x46, @LSR, @zeroPageMode,    no,  yes # 5 cycles
+        @registerOperation 0x56, @LSR, @zeroPageXMode,   no,  yes # 6 cycles
+        @registerOperation 0x4E, @LSR, @absoluteMode,    no,  yes # 6 cycles
+        @registerOperation 0x5E, @LSR, @absoluteXMode,   yes, yes # 7 cycles
+
+        @registerOperation 0x2A, @ROL, @accumulatorMode, no,  no  # 2 cycles
+        @registerOperation 0x26, @ROL, @zeroPageMode,    no,  yes # 5 cycles
+        @registerOperation 0x36, @ROL, @zeroPageXMode,   no,  yes # 6 cycles
+        @registerOperation 0x2E, @ROL, @absoluteMode,    no,  yes # 6 cycles
+        @registerOperation 0x3E, @ROL, @absoluteXMode,   yes, yes # 7 cycles
+
+        @registerOperation 0x6A, @ROR, @accumulatorMode, no,  no  # 2 cycles
+        @registerOperation 0x66, @ROR, @zeroPageMode,    no,  yes # 5 cycles
+        @registerOperation 0x76, @ROR, @zeroPageXMode,   no,  yes # 6 cycles
+        @registerOperation 0x6E, @ROR, @absoluteMode,    no,  yes # 6 cycles
+        @registerOperation 0x7E, @ROR, @absoluteXMode,   yes, yes # 7 cycles

     registerOperation: (operationCode, instruction, addressingMode, emptyReadCycle, emptyWriteCycle) ->
         @operationsTable[operationCode] =


add missing closing paren

add missing closing paren

--- lib/wakatime.coffee
+++ lib/wakatime.coffee
@@ -45,6 +45,7 @@
           window.alert('Please install Python (https://www.python.org/downloads/) and restart Atom to enable the WakaTime plugin.')
       else
         checkCLI()
+    )

   consumeStatusBar: (statusBar) ->
     statusBarTileView = new StatusBarTileView()


add VDI migration on another SR

add VDI migration on another SR

--- src/api/vdi.coffee
+++ src/api/vdi.coffee
@@ -21,9 +21,9 @@

   return true
 exports.delete.permission = 'admin'
-exports.delete.params =
-  id:
-    type: 'string'
+exports.delete.params = {
+  id: { type: 'string' }
+}

 # FIXME: human readable strings should be handled.
 exports.set = (params) ->
@@ -71,3 +71,22 @@
   # size of VDI
   size: { type: 'integer', optional: true }
 }
+
+exports.migrate = ({id, sr_id}) ->
+  try
+    VDI = @getObject id, 'VDI'
+    SR = @getObject sr_id, 'SR'
+  catch
+    @throw 'NO_SUCH_OBJECT'
+
+  xapi = @getXAPI VDI
+
+  # TODO: check if VDI is attached before
+  $wait xapi.call 'VDI.pool_migrate', VDI.ref, SR.ref, {}
+
+  return true
+exports.delete.permission = 'admin'
+exports.delete.params = {
+  id: { type: 'string' }
+  sr_id: { type: 'string' }
+}


guard error reporting

guard error reporting

--- src/context.coffee
+++ src/context.coffee
@@ -126,7 +126,7 @@
         change   = @attributes.digest()
         change ||= @model     .digest()
       last: () ->
-        {attribute: @attributes.getLastTrigger(), model: @attributes.getLastTrigger()}
+        {attribute: @attributes.getLastTrigger(), model: @model.getLastTrigger()}

     @root.controller.update?()


Modified in browser at pixie.strd6.com

Modified in browser at pixie.strd6.com

--- src/timed_events.coffee
+++ src/timed_events.coffee
@@ -1,4 +1,4 @@
 TimedEvents = (I={}) ->
   every: (n, fn) ->
     if I.age.mod(n) is 0
-      doSomething()
+      fn()


Rename EditSession to Editor

Rename EditSession to Editor

--- src/project.coffee
+++ src/project.coffee
@@ -63,7 +63,7 @@

   # Private:
   destroy: ->
-    editor.destroy() for editor in @getEditSessions()
+    editor.destroy() for editor in @getEditors()
     buffer.release() for buffer in @getBuffers()
     @destroyRepo()

@@ -161,7 +161,7 @@
       Q(resource)
     else
       @bufferForPath(filePath).then (buffer) =>
-        @buildEditSessionForBuffer(buffer, options)
+        @buildEditorForBuffer(buffer, options)

   # Private: Only be used in specs
   openSync: (filePath, options={}) ->
@@ -169,21 +169,21 @@
     for opener in @openers
       return resource if resource = opener(filePath, options)

-    @buildEditSessionForBuffer(@bufferForPathSync(filePath), options)
+    @buildEditorForBuffer(@bufferForPathSync(filePath), options)

   # Public: Retrieves all {Editor}s for all open files.
   #
   # Returns an {Array} of {Editor}s.
-  getEditSessions: ->
+  getEditors: ->
     new Array(@editors...)

   # Public: Add the given {Editor}.
-  addEditSession: (editor) ->
+  addEditor: (editor) ->
     @editors.push editor
     @emit 'editor-created', editor

   # Public: Return and removes the given {Editor}.
-  removeEditSession: (editor) ->
+  removeEditor: (editor) ->
     _.remove(@editors, editor)

   # Private: Retrieves all the {TextBuffer}s in the project; that is, the
@@ -343,14 +343,14 @@
     deferred.promise

   # Private:
-  buildEditSessionForBuffer: (buffer, editorOptions) ->
+  buildEditorForBuffer: (buffer, editorOptions) ->
     editor = new Editor(_.extend({buffer}, editorOptions))
-    @addEditSession(editor)
+    @addEditor(editor)
     editor

   # Private:
-  eachEditSession: (callback) ->
-    callback(editor) for editor in @getEditSessions()
+  eachEditor: (callback) ->
+    callback(editor) for editor in @getEditors()
     @on 'editor-created', (editor) -> callback(editor)

   # Private:


Correct 'Renewal used' labels for checkout details

--- src/account/checkouts.coffee
+++ src/account/checkouts.coffee
@@ -34,7 +34,7 @@

 						Due date
-						Renewal used
+						Renews left

@@ -54,7 +54,7 @@

 						<%= circ_type %>
 						Due date
-						Renewal used
+						Renews left


CC: followUpcomingEvents: listen 'reinit' events too if status in Building or Terminating

--- client/Main/providers/computecontroller.coffee
+++ client/Main/providers/computecontroller.coffee
@@ -365,7 +365,12 @@
     stateEvent = StateEventMap[machine.status.state]

     if stateEvent
+
       @eventListener.addListener stateEvent, machine._id
+
+      if stateEvent in ["build", "destroy"]
+        @eventListener.addListener "reinit", machine._id
+
       return yes

     return no


Environment: Use "force" parameter

Environment: Use "force" parameter

--- client/app/lib/flux/environment/actions.coffee
+++ client/app/lib/flux/environment/actions.coffee
@@ -107,7 +107,7 @@
         reactor.dispatch actions.LOAD_USER_STACKS_SUCCESS, stacks
         resolve stacks
         _bindStackEvents()
-    , yes
+    , force

 rejectInvitation = (machine) ->


Main: minor fix

Main: minor fix

--- client/landing/site.landing/coffee/main.coffee
+++ client/landing/site.landing/coffee/main.coffee
@@ -1,13 +1,15 @@
 console.time 'Koding.com loaded'
+
+# keep this on top
+MainController = require './core/maincontrollerloggedout'

 # register appclasses
 About = require './about/AppController'
 Home  = require './home/AppController'
 Login = require './login/AppController'

+
 # bootstrap app
-MainController = require './core/maincontrollerloggedout'
-
 do ->

   setConfig = ->


Change legend position

Change legend position

--- client/templates/results/chart/chart.js.coffee
+++ client/templates/results/chart/chart.js.coffee
@@ -32,6 +32,8 @@
         height: @chartHeight
         curveType: "function"
         series: series
+        legend:
+          position: "bottom"
         vAxis:
           logScale: true
         hAxis:


Tests: Messages: PrivateMessage: Added startConversationWithPurpose test.

--- client/test/lib/messages/privatemessage.coffee
+++ client/test/lib/messages/privatemessage.coffee
@@ -15,6 +15,18 @@
     helpers.beginTest(browser)

     messagesHelpers.startConversation(browser, messageUser)
+    browser.end()
+
+
+  startConversationWithPurpose: (browser) ->
+
+    messageUser =
+      userName  : 'testuser1'
+      fullName  : 'Test1 User1'
+
+    helpers.beginTest(browser)
+
+    messagesHelpers.startConversation(browser, messageUser, 'Hello World!', 'My Purpose')
     browser.end()

@@ -59,3 +71,4 @@

     browser.end()

+


there was some weird thing where isMounted as return false during the tests so then i did that wierd function = null thing on componentWillUnmount, but that doesn't seem necessary anymore, so yay!

--- src/components/tutor-popover.cjsx
+++ src/components/tutor-popover.cjsx
@@ -43,10 +43,8 @@

       @setState(imagesLoading: imagesLoading, firstShow: false)

-  componentWillUnmount: ->
-    @imageLoaded = -> null
-
   imageLoaded: (iter) ->
+    return unless @isMounted()
     @refs.popper?.updateOverlayPosition()
     {imagesLoading} = @state


Fix test spec

Fix test spec

--- components/clock/test/view.coffee
+++ components/clock/test/view.coffee
@@ -46,7 +46,7 @@
       @view.model.set
         is_auction: true
         start_at: moment().subtract(1, 'minutes').format()
-        end_at: moment().add(3, 'minutes').add(1, 'months').add(1, 'hours').add(1, 'seconds').format()
+        end_at: moment().add(3, 'minutes').add(1, 'months').add(1, 'hours').add(1, 'seconds').add(1, 'days').format()

       @view.model.calculateOffsetTimes()
       Backbone.sync.args[0][2].success { time: moment().format() }


Fixes #370. Allow Promises in allOptions for beautification

--- src/beautifiers/index.coffee
+++ src/beautifiers/index.coffee
@@ -288,195 +288,201 @@

     beautify : (text, allOptions, grammar, filePath, {onSave} = {}) ->
-        return new Promise((resolve, reject) =>
-            logger.info('beautify', text, allOptions, grammar, filePath)
-            logger.verbose(allOptions)
-
-            # Get language
-            fileExtension = path.extname(filePath)
-            # Remove prefix "." (period) in fileExtension
-            fileExtension = fileExtension.substr(1)
-            languages = @languages.getLanguages({grammar, extension: fileExtension})
-            logger.verbose(languages, grammar, fileExtension)
-
-            # Check if unsupported language
-            if languages.length < 1
-                unsupportedGrammar = true
-
-
-                # Check if on save
-                if onSave
-
-                    # Ignore this, as it was just a general file save, and
-                    # not intended to be beautified
-                    return resolve( null )
-            else
-
-                # TODO: select appropriate language
-                language = languages[0]
-
-
-                # Get language config
-                langDisabled = atom.config.get("atom-beautify.language_#{language.namespace}_disabled")
-
-
-                # Beautify!
-                unsupportedGrammar = false
-
-
-                # Check if Language is disabled
-                if langDisabled
-                    return resolve( null )
-
-                # Get more language config
-                preferredBeautifierName = atom.config.get("atom-beautify.language_#{language.namespace}_default_beautifier")
-                beautifyOnSave = atom.config.get("atom-beautify.language_#{language.namespace}_beautify_on_save")
-                legacyBeautifyOnSave = atom.config.get("atom-beautify.beautifyOnSave")
-
-
-                # Verify if beautifying on save
-                if onSave and not (beautifyOnSave or legacyBeautifyOnSave)
-
-                    # Saving, and beautify on save is disabled
-                    return resolve( null )
-
-                # Options for Language
-                options = @getOptions([language.namespace].concat(language.fallback or []), allOptions) or {}
-
-                # Get Beautifier
-                logger.verbose(grammar, language)
-                beautifiers = @getBeautifiers(language.name, options)
-
-                logger.verbose('options', options)
-                logger.verbose('beautifiers', beautifiers)
-
-                logger.verbose(language.name, filePath, options, allOptions)
+        return Promise.all(allOptions)
+        .then((allOptions) =>
+            return new Promise((resolve, reject) =>
+                logger.info('beautify', text, allOptions, grammar, filePath)
+                logger.verbose(allOptions)
+
+                # Get language
+                fileExtension = path.extname(filePath)
+                # Remove prefix "." (period) in fileExtension
+                fileExtension = fileExtension.substr(1)
+                languages = @languages.getLanguages({grammar, extension: fileExtension})
+                logger.verbose(languages, grammar, fileExtension)

                 # Check if unsupported language
-                if beautifiers.length < 1
+                if languages.length < 1
                     unsupportedGrammar = true
+
+
+                    # Check if on save
+                    if onSave
+
+                        # Ignore this, as it was just a general file save, and
+                        # not intended to be beautified
+                        return resolve( null )
                 else
-                    # Select beautifier from language config preferences
-                    beautifier = _.find(beautifiers, (beautifier) ->
-                        beautifier.name is preferredBeautifierName
-                    ) or beautifiers[0]
-                    logger.verbose('beautifier', beautifier.name, beautifiers)
-                    transformOptions = (beautifier, languageName, options) ->
-
-                        # Transform options, if applicable
-                        beautifierOptions = beautifier.options[languageName]
-                        if typeof beautifierOptions is "boolean"
-
-                            # Language is supported by beautifier
-                            # If true then all options are directly supported
-                            # If falsy then pass all options to beautifier,
-                            # although no options are directly supported.
-                            return options
-                        else if typeof beautifierOptions is "object"
-
-                            # Transform the options
-                            transformedOptions = {}
-
-
-                            # Transform for fields
-                            for field, op of beautifierOptions
-                                if typeof op is "string"
-
-                                    # Rename
-                                    transformedOptions[field] = options[op]
-                                else if typeof op is "function"
-
-                                    # Transform
-                                    transformedOptions[field] = op(options[field])
-                                else if typeof op is "boolean"
-
-                                    # Enable/Disable
-                                    if op is true
-                                        transformedOptions[field] = options[field]
-                                else if _.isArray(op)
-
-                                    # Complex function
-                                    [fields..., fn] = op
-                                    vals = _.map(fields, (f) ->
-                                        return options[f]
-                                    )
-
-
-                                    # Apply function
-                                    transformedOptions[field] = fn.apply( null , vals)
-
-                            # Replace old options with new transformed options
-                            return transformedOptions
-                        else
-                            logger.warn("Unsupported Language options: ", beautifierOptions)
-                            return options
-
-                    # Apply language-specific option transformations
-                    options = transformOptions(beautifier, language.name, options)
-
-                    # Beautify text with language options
-                    beautifier.beautify(text, language.name, options)
-                    .then(resolve)
-                    .catch(reject)
-
-            # Check if Analytics is enabled
-            if atom.config.get("atom-beautify.analytics")
-
-                # Setup Analytics
-                analytics = new Analytics(analyticsWriteKey)
-                unless atom.config.get("atom-beautify._analyticsUserId")
-                    uuid = require("node-uuid")
-                    atom.config.set "atom-beautify._analyticsUserId", uuid.v4()
-
-                # Setup Analytics User Id
-                userId = atom.config.get("atom-beautify._analyticsUserId")
-                analytics.identify userId : userId
-                version = pkg.version
-                analytics.track
-                    userId : atom.config.get("atom-beautify._analyticsUserId")
-                    event : "Beautify"
-                    properties :
-                        language : language?.name
-                        grammar : grammar
-                        extension : fileExtension
-                        version : version
-                        options : allOptions
-                        label : language?.name
-                        category : version
-
-            if unsupportedGrammar
-                if atom.config.get("atom-beautify.muteUnsupportedLanguageErrors")
-                    return resolve( null )
-                else
-                    repoBugsUrl = pkg.bugs.url
-
-
-                    # issueTitle = "Add support for language with grammar '
-                    # issueBody = """
-                    #
-                    # **Atom Version**:
-                    # **Atom Beautify Version**:
-                    # **Platform**:
-                    #
-                    # ```
-                    #
-                    # ```
-                    #
-                    # """
-                    # requestLanguageUrl = "
-                    # detail = "If you would like to request this language be supported please create an issue by clicking <a href=\"
-                    title = "Atom Beautify could not find a supported beautifier for this file"
-                    detail = """
-                             Atom Beautify could not determine a supported beautifier to handle this file with grammar \"#{grammar}\" and extension \"#{fileExtension}\". \
-                             If you would like to request support for this file and it's language, please create an issue for Atom Beautify at #{repoBugsUrl}
-                             """
-
-                    atom?.notifications.addWarning(title, {
-                        detail
-                        dismissable : true
-                    })
-                    return resolve( null )
-                    )
+
+                    # TODO: select appropriate language
+                    language = languages[0]
+
+
+                    # Get language config
+                    langDisabled = atom.config.get("atom-beautify.language_#{language.namespace}_disabled")
+
+
+                    # Beautify!
+                    unsupportedGrammar = false
+
+
+                    # Check if Language is disabled
+                    if langDisabled
+                        return resolve( null )
+
+                    # Get more language config
+                    preferredBeautifierName = atom.config.get("atom-beautify.language_#{language.namespace}_default_beautifier")
+                    beautifyOnSave = atom.config.get("atom-beautify.language_#{language.namespace}_beautify_on_save")
+                    legacyBeautifyOnSave = atom.config.get("atom-beautify.beautifyOnSave")
+
+
+                    # Verify if beautifying on save
+                    if onSave and not (beautifyOnSave or legacyBeautifyOnSave)
+
+                        # Saving, and beautify on save is disabled
+                        return resolve( null )
+
+                    # Options for Language
+                    options = @getOptions([language.namespace].concat(language.fallback or []), allOptions) or {}
+
+                    # Get Beautifier
+                    logger.verbose(grammar, language)
+                    beautifiers = @getBeautifiers(language.name, options)
+
+                    logger.verbose('options', options)
+                    logger.verbose('beautifiers', beautifiers)
+
+                    logger.verbose(language.name, filePath, options, allOptions)
+
+                    # Check if unsupported language
+                    if beautifiers.length < 1
+                        unsupportedGrammar = true
+                    else
+                        # Select beautifier from language config preferences
+                        beautifier = _.find(beautifiers, (beautifier) ->
+                            beautifier.name is preferredBeautifierName
+                        ) or beautifiers[0]
+                        logger.verbose('beautifier', beautifier.name, beautifiers)
+                        transformOptions = (beautifier, languageName, options) ->
+
+                            # Transform options, if applicable
+                            beautifierOptions = beautifier.options[languageName]
+                            if typeof beautifierOptions is "boolean"
+
+                                # Language is supported by beautifier
+                                # If true then all options are directly supported
+                                # If falsy then pass all options to beautifier,
+                                # although no options are directly supported.
+                                return options
+                            else if typeof beautifierOptions is "object"
+
+                                # Transform the options
+                                transformedOptions = {}
+
+
+                                # Transform for fields
+                                for field, op of beautifierOptions
+                                    if typeof op is "string"
+
+                                        # Rename
+                                        transformedOptions[field] = options[op]
+                                    else if typeof op is "function"
+
+                                        # Transform
+                                        transformedOptions[field] = op(options[field])
+                                    else if typeof op is "boolean"
+
+                                        # Enable/Disable
+                                        if op is true
+                                            transformedOptions[field] = options[field]
+                                    else if _.isArray(op)
+
+                                        # Complex function
+                                        [fields..., fn] = op
+                                        vals = _.map(fields, (f) ->
+                                            return options[f]
+                                        )
+
+
+                                        # Apply function
+                                        transformedOptions[field] = fn.apply( null , vals)
+
+                                # Replace old options with new transformed options
+                                return transformedOptions
+                            else
+                                logger.warn("Unsupported Language options: ", beautifierOptions)
+                                return options
+
+                        # Apply language-specific option transformations
+                        options = transformOptions(beautifier, language.name, options)
+
+                        # Beautify text with language options
+                        beautifier.beautify(text, language.name, options)
+                        .then(resolve)
+                        .catch(reject)
+
+                # Check if Analytics is enabled
+                if atom.config.get("atom-beautify.analytics")
+
+                    # Setup Analytics
+                    analytics = new Analytics(analyticsWriteKey)
+                    unless atom.config.get("atom-beautify._analyticsUserId")
+                        uuid = require("node-uuid")
+                        atom.config.set "atom-beautify._analyticsUserId", uuid.v4()
+
+                    # Setup Analytics User Id
+                    userId = atom.config.get("atom-beautify._analyticsUserId")
+                    analytics.identify userId : userId
+                    version = pkg.version
+                    analytics.track
+                        userId : atom.config.get("atom-beautify._analyticsUserId")
+                        event : "Beautify"
+                        properties :
+                            language : language?.name
+                            grammar : grammar
+                            extension : fileExtension
+                            version : version
+                            options : allOptions
+                            label : language?.name
+                            category : version
+
+                if unsupportedGrammar
+                    if atom.config.get("atom-beautify.muteUnsupportedLanguageErrors")
+                        return resolve( null )
+                    else
+                        repoBugsUrl = pkg.bugs.url
+
+
+                        # issueTitle = "Add support for language with grammar '
+                        # issueBody = """
+                        #
+                        # **Atom Version**:
+                        # **Atom Beautify Version**:
+                        # **Platform**:
+                        #
+                        # ```
+                        #
+                        # ```
+                        #
+                        # """
+                        # requestLanguageUrl = "
+                        # detail = "If you would like to request this language be supported please create an issue by clicking <a href=\"
+                        title = "Atom Beautify could not find a supported beautifier for this file"
+                        detail = """
+                                 Atom Beautify could not determine a supported beautifier to handle this file with grammar \"#{grammar}\" and extension \"#{fileExtension}\". \
+                                 If you would like to request support for this file and it's language, please create an issue for Atom Beautify at #{repoBugsUrl}
+                                 """
+
+                        atom?.notifications.addWarning(title, {
+                            detail
+                            dismissable : true
+                        })
+                        return resolve( null )
+                        )
+
+            )
+
+
     findFileResults : {}


Use the new status/send/sendStatus style.

--- src/api.coffee
+++ src/api.coffee
@@ -14,43 +14,43 @@
 		if req.query.apikey is secret
 			next()
 		else
-			res.send(401)
+			res.sendStatus(401)

 	api.post '/v1/blink', (req, res) ->
 		utils.mixpanelTrack('Device blink')
 		utils.blink.pattern.start()
 		setTimeout(utils.blink.pattern.stop, 15000)
-		res.send(200)
+		res.sendStatus(200)

 	api.post '/v1/update', (req, res) ->
 		utils.mixpanelTrack('Update notification')
 		application.update()
-		res.send(204)
+		res.sendStatus(204)

 	api.post '/v1/spawn-tty', (req, res) ->
 		appId = req.body.appId
 		utils.mixpanelTrack('Spawn tty', appId)
 		if !appId?
-			res.send(400, 'Missing app id')
+			res.status(400).send('Missing app id')
 		knex('app').select().where({appId})
 		.then ([ app ]) ->
 			if !app?
 				throw new Error('App not found')
 			tty.start(app)
 		.then (url) ->
-			res.send(200, url)
+			res.status(200).send(url)
 		.catch (err) ->
-			res.send(503, err?.message or err or 'Unknown error')
+			res.status(503).send(err?.message or err or 'Unknown error')

 	api.post '/v1/despawn-tty', (req, res) ->
 		appId = req.body.appId
 		utils.mixpanelTrack('Despawn tty', appId)
 		if !appId?
-			res.send(400, 'Missing app id')
+			res.status(400).send('Missing app id')
 		tty.stop(appId)
 		.then ->
-			res.send(200)
+			res.sendStatus(200)
 		.catch (err) ->
-			res.send(503, err?.message or err or 'Unknown error')
+			res.status(503).send(err?.message or err or 'Unknown error')

 	return api


Clean

Clean

--- src/app.coffee
+++ src/app.coffee
@@ -13,14 +13,11 @@

 # all environments
 app.set 'port', process.env.PORT or 4000
-app.set 'views', __dirname + '/views'
-app.set 'view engine', 'jade'
 app.use express.favicon()
 app.use express.logger('dev')
 app.use express.bodyParser()
 app.use express.methodOverride()
-app.use require('stylus').middleware(__dirname + '/public')
-app.use express.static(path.join(__dirname, 'public'))
+app.use express.static(path.join(__dirname, '../public'))
 app.use app.router

 # development only


Add compatibility check for html5 routing mode

--- src/app.coffee
+++ src/app.coffee
@@ -2,7 +2,7 @@

 app.config ($locationProvider) ->

-    # if window.history && window.history.pushState
-    $locationProvider.html5Mode true
+    if window.history && window.history.pushState
+        $locationProvider.html5Mode true

 module.exports = app


NEed to add in error handling around use registration and stuff

--- src/app.coffee
+++ src/app.coffee
@@ -61,7 +61,7 @@
     res.locals.accessToken = req.session.accessToken
     return next()
   else
-    crypto.randomBytes 24, (ex, buf) ->
+    crypto.randomBytes 48, (ex, buf) ->
       accessToken = buf.toString('hex')
       app.db.OauthClient.find({where: {userId: req.user.id, type: "internal"}}).complete (err, client) ->
         if err


Fix case on method call

Fix case on method call

--- src/aws.coffee
+++ src/aws.coffee
@@ -146,7 +146,7 @@
       else
         message = "There are no matches for `#{query}`"
         message += " that have been running for at least #{duration.humanize()}" if duration?
-        robot.messageroom room, message
+        robot.messageRoom room, message

   robot.respond /aws jobs/, (msg) ->
     listJobs msg.message.room


cleaned up and fixed bugs in functions.coffee

--- src/builtin/functions.coffee
+++ src/builtin/functions.coffee
@@ -1,31 +1,32 @@
 # **To-do** Implement tuple support for classinfo.
-issubclass = (classArg, classinfo) ->
-  return classArg is classinfo or classinfo in classArg.__bases__()
+abs = (operand) ->
+  operand.__abs__()

 cmp = (operand1, operand2) ->
-  return operand1.__cmp__(operand2)
+  operand1.__cmp__(operand2)

+float = (operand) ->
+  new Num(window.Number(operand.value))
+
+issubclass = (classArg, classinfo) ->
+  # [Relevant](http://docs.python.org/library/functions.html#issubclass)
+  classArg is classinfo or classinfo in classArg.__bases__()
+
 pow = (operand1, operand2) ->
-  return operand1.__pow__(operand2)
+  operand1.__pow__(operand2)

-abs = (operand) ->
-  return operand.__abs__()
+print = (object) ->
+  console.log(object)

-float = (operand) ->
-  return new Num(window.Number(operand))
-
+repr = (operand) ->
+  operand.__repr__()
+
 str = (operand) ->
   if operand?
-    return operand.__str__()
+    operand.__str__()
   else
     # [Relevant](http://docs.python.org/library/functions.html#str)
-    return ''
-
-repr = (operand) ->
-  return operand.__repr__()
+    ''

 type = (object) ->
-  return object.constructor
-
-print = (object) ->
-  console.log(object)
+  object.constructor


Log the experimental split to Geordi

Log the experimental split to Geordi

--- app/controllers/subject_viewer.coffee
+++ app/controllers/subject_viewer.coffee
@@ -74,6 +74,7 @@
       Experiments.getExperiment(currentExperiment).done(
         (data) =>
           @classification.cohort = Experiments.getCohort(data)
+          AnalyticsLogger.logEvent 'experimentalSplit', @classification.cohort
           @html template @classification

           @active = Math.floor @classification.subject.location.standard.length / 2


Spacing multiple operators.

Spacing multiple operators.

--- nodes.coffee
+++ nodes.coffee
@@ -1108,7 +1108,7 @@

   # Compile a unary **Op**.
   compileUnary: (o) ->
-    space = if @operator in @PREFIX_OPERATORS then ' ' else ''
+    space = if @operator in @PREFIX_OPERATORS or @first instanceof Op then ' ' else ''
     parts = [@operator, space, @first.compile(o, LVL_OP)]
     (if @flip then parts.reverse() else parts).join ''


Fix sign styles

Fix sign styles

--- dev/standard.cson
+++ dev/standard.cson
@@ -88,7 +88,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'right-of-way', value: 'black' }
+      { type: 'right-of-way fit', value: 'black' }
     ]

   danger_road_works:
@@ -97,7 +97,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'roadworks', value: 'black' }
+      { type: 'roadworks fit', value: 'black' }
     ]

   mandatory_roundabout:
@@ -138,7 +138,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'bump', value: 'black' }
+      { type: 'bump fit', value: 'black' }
     ]

   danger_danger:
@@ -147,7 +147,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'exclamation', value: 'black' }
+      { type: 'exclamation fit', value: 'black' }
     ]

   prohibitory_no_parking_or_stopping:
@@ -185,7 +185,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'right-of-way-l', value: 'black' }
+      { type: 'right-of-way-l fit', value: 'black' }
       ]

   mandatory_go_left_or_right:
@@ -211,7 +211,7 @@
     name: 'go straight'
     elements: [
       { type: 'circle-bg', value: 'blue' }
-      { type: 'arrow-straight', value: 'blue' }
+      { type: 'arrow-straight', value: 'white' }
     ]

   mandatory_go_left:
@@ -219,7 +219,7 @@
     name: 'go left'
     elements: [
       { type: 'circle-bg', value: 'blue' }
-      { type: 'arrow-l', value: 'blue' }
+      { type: 'arrow-l', value: 'white' }
     ]

   mandatory_go_right:
@@ -227,7 +227,7 @@
     name: 'go right'
     elements: [
       { type: 'circle-bg', value: 'blue' }
-      { type: 'arrow-r', value: 'blue' }
+      { type: 'arrow-r', value: 'white' }
     ]

   priority_stop:
@@ -264,7 +264,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'd-curve-r', value: 'black' }
+      { type: 'd-curve-r fit', value: 'black' }
     ]

   danger_bend_first_left:
@@ -273,7 +273,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'd-curve-l', value: 'black' }
+      { type: 'd-curve-l fit', value: 'black' }
     ]

   information_disable_persons:
@@ -344,6 +344,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
+      { type: 'narrow-road-both fit', value: 'black' }
     ]

   danger_cycle_crossing:
@@ -351,7 +352,7 @@
     name: 'cycle crossing'
     elements: [
       { type: 'tri-bg', value: 'white' }
-      { type: 'tri-bg', value: 'white' }
+      { type: 'tri-o', value: 'red' }
       { type: 'bicycle fit', value: 'black'}
     ]

@@ -370,7 +371,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'slippery-road', value: 'black'}
+      { type: 'slippery-road fit', value: 'black'}
     ]

   danger_pedestrian_crossing:
@@ -379,7 +380,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'pedestrian', value: 'black' }
+      { type: 'pedestrian fit', value: 'black' }
     ]

   danger_quayside_or_ferry_berth:
@@ -388,7 +389,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'cliff', value: 'black' }
+      { type: 'cliff fit', value: 'black' }
     ]

@@ -398,7 +399,7 @@
     elements: [
       { type: 'tri-bg', value: 'white' }
       { type: 'tri-o', value: 'red' }
-      { type: 'motor-vehicles', value: 'black' }
+      { type: 'motor-vehicles fit', value: 'black' }
     ]

 }


Fix of Typo

Fix of Typo

--- app/pages/about/acknowledgements.cjsx
+++ app/pages/about/acknowledgements.cjsx
@@ -12,7 +12,7 @@

     We ask that all researchers making use of the Zooniverse Project Builder platform in any way also consider including the above acknowledgement in their publications.

-    We strongly encourage project owners to report published accepted research publications using Zooniverse-produced data to us via [this form](https://docs.google.com/forms/d/e/1FAIpQLSdbAKVT2tGs1WfBqWNrMekFE5lL4ZuMnWlwJuCuNM33QO2ZYg/viewform). You can find a list of publications written using the Zooniverse on our [Publications page](publications).
+    We strongly encourage project owners to report publish accepted research publications using Zooniverse-produced data to us via [this form](https://docs.google.com/forms/d/e/1FAIpQLSdbAKVT2tGs1WfBqWNrMekFE5lL4ZuMnWlwJuCuNM33QO2ZYg/viewform). You can find a list of publications written using the Zooniverse on our [Publications page](publications).

     If you have any questions about how to acknowledge the Zooniverse, such as referencing a particular individual or custom code, please [get in touch](contact).
 '''


refactor(macUpload): Removed calling digest cycle when changing class on dropzone

--- src/directives/file_upload.coffee
+++ src/directives/file_upload.coffee
@@ -94,7 +94,7 @@
         dragoverTimeout = $timeout ->
           clearTimeout(dragoverTimeout) if dragoverTimeout?
           dropZone.removeClass "droppable"
-        , 250
+        , 250, false

     options.dropZone  = dropZone or $()
     options.pasteZone = null


Fix negative data

Fix negative data

--- views/components/ship-parts/slotitems-data.coffee
+++ views/components/ship-parts/slotitems-data.coffee
@@ -36,6 +36,6 @@
   getItemData: (slotitem) ->
     data = []
     for type of types
-      if slotitem[type] > 0
+      if slotitem[type]? && slotitem[type] != 0
         data.push "#{__ types[type]}: #{slotitem[type]}"
     return data


Slow down sunrise

Slow down sunrise

--- app/scripts/lazerscripts/lunch.coffee
+++ app/scripts/lazerscripts/lunch.coffee
@@ -161,7 +161,7 @@
       @loadAssets images: ['city.png']
       @loadAssets images: ['city.png', 'city-layer2.png']
       @checkpoint @setScenery('OceanOld')
-      @async @runScript(Game.Scripts.SunRise, skipTo: 0, speed: 6)
+      @async @runScript(Game.Scripts.SunRise, skipTo: 0, speed: 4)
       @setScenery('OceanToNew')
       @placeSquad Game.Scripts.Swirler,
         drop: 'lasers'


rollbar: log protocol for geraint

rollbar: log protocol for geraint

--- client/Main/main.coffee
+++ client/Main/main.coffee
@@ -50,7 +50,7 @@
     notifyUser = options.notifyUser or= "yes"
     state      = "disconnected"

-    KD.logToExternalWithTime "User disconnected"
+    KD.logToExternalWithTime "User disconnected", protocol: KD.remote.mq.ws.protocol

     log "disconnected",\
     "reason: #{reason}, modalSize: #{modalSize}, notifyUser: #{notifyUser}"


use valueAttr in comp() instead of hardcoded name attribute

--- src/chz.coffee
+++ src/chz.coffee
@@ -1,8 +1,8 @@
 comp = (a, b)->
   a.toLowerCase().indexOf(b.toLowerCase()) > -1

-filter = (x, xs)->
-  if x then xs.filter ((i)-> comp(i.name, x)) else xs
+filter = (x, xs, valueAttr)->
+  if x then xs.filter ((i)-> comp(i[valueAttr], x)) else xs

 focuz = (el)->
   window.setTimeout((()-> el.focus()) , 0)
@@ -61,7 +61,7 @@

     search = (q) ->
       if $scope.prevSearch != q
-        $scope.shownItems = filter(q, $scope.items).slice(0, $scope.limit)
+        $scope.shownItems = filter(q, $scope.items, $scope.valueAttr).slice(0, $scope.limit)
         $scope.activeItem = $scope.shownItems[0]
       $scope.prevSearch = q


Sort each weeks events when reading them

This way they're guaranteed to be in the correct order when
the helper methods read a particular week.  The BE usually
sends them in order, but there's been some cases reported
where they were not.

--- src/flux/student-dashboard.coffee
+++ src/flux/student-dashboard.coffee
@@ -2,11 +2,6 @@
 {TimeStore} = require './time'
 _ = require 'underscore'
 moment = require 'moment'
-
-addEvents = (hash, events) ->
-  for event in events
-    week = hash[ moment(event.due_at).startOf('isoweek').format('YYYYww') ] ||= []
-    week.push(event)

 arrayToSentence = (arry) ->
   if arry.length > 1
@@ -23,12 +18,15 @@
   exports:

     eventsByWeek: (courseId) ->
-      return @_weeks if @weeks
+      return @_weeks if @_weeks
       data = @_get(courseId)
-      @_weeks = {}
-      addEvents(@_weeks, data.tasks) if data.tasks
-      addEvents(@_weeks, data.exams) if data.exams
-      @_weeks
+      tasks = data.tasks or []
+      weeks = _.groupBy tasks, (event) ->
+        moment(event.due_at).startOf('isoweek').format('YYYYww')
+      sorted = {}
+      for weekId, events of weeks
+        sorted[weekId] = _.sortBy(events, 'due_at')
+      @_weeks = sorted

     pastEventsByWeek: (courseId) ->
       weeks = this.exports.eventsByWeek.call(this, courseId)


[Email Confirmation] Send username in error data field

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -299,10 +299,13 @@
           else
             afterLogin connection, user, clientId, session, callback

-  checkUserStatus = (user, callback)->
+  checkUserStatus = (user, account, callback)->
     if user.status is 'unconfirmed' and KONFIG.emailConfirmationCheckerWorker.enabled
-      error = createKodingError "You must confirm your email address to continue using Koding.com"
+      error = createKodingError "CONFIRMATION_WAITING"
       error.code = 403
+      error.data or= {}
+      error.data.name = account.profile.firstName or account.profile.nickname
+      error.data.nickname = account.profile.nickname
       return callback error
     return callback null

@@ -310,7 +313,7 @@
   checkLoginConstraints = (user, account, callback)->
     checkBlockedStatus user, (err)->
       return callback err  if err
-      checkUserStatus user, callback
+      checkUserStatus user, account, callback

   afterLogin = (connection, user, clientId, session, callback)->
     user.fetchOwnAccount (err, account)->


label all bounds of color scale

label all bounds of color scale

--- src/coffee/choropleth.coffee
+++ src/coffee/choropleth.coffee
@@ -39,7 +39,7 @@
             data_by_iso[d.iso3] = val

         # Set the coloring function.
-        colorize = d3.scale.quantize()
+        geomap.colorize = d3.scale.quantize()
             .domain([min, max])
             .range(geomap.properties.colors)

@@ -47,7 +47,7 @@
             if data_by_iso[iso3] then geomap.properties.format(data_by_iso[iso3]) else 'No data'

         color_val = (iso3)->
-            if data_by_iso[iso3] then colorize(data_by_iso[iso3]) else '#eeeeee'
+            if data_by_iso[iso3] then geomap.colorize(data_by_iso[iso3]) else '#eeeeee'

         geomap.private.units.enter().append('path')
             .attr('class', 'unit')
@@ -98,16 +98,6 @@
         sg = lg.append('g')
             .attr('transform', l_tr)

-        sg.append('text')
-            .text(geomap.properties.format(max_val))
-            .attr('x', rect_w + offset_t)
-            .attr('y', offset_t)
-
-        sg.append('text')
-            .text(geomap.properties.format(min_val))
-            .attr('x', rect_w + offset_t)
-            .attr('y', legend_h + offset_t)
-
         # draw color scale
         sg.selectAll('rect')
             .data(colorlist)
@@ -117,8 +107,18 @@
             .attr('width', rect_w)
             .attr('height', rect_h)

-        # TODO use colorize.invertExtent(colorval) to label each bin
+        # draw color scale labels
+        sg.selectAll('text')
+            .data(colorlist)
+            .enter().append('text')
+            .text((d)-> geomap.properties.format geomap.colorize.invertExtent(d)[0])
+            .attr('x', rect_w + offset_t)
+            .attr('y', (d, i)-> i * rect_h + rect_h + offset_t)

+        sg.append('text')
+            .text(geomap.properties.format(max_val))
+            .attr('x', rect_w + offset_t)
+            .attr('y', offset_t)

 (exports? or this).d3.geomap.choropleth = ()->
     new Choropleth()


add beforeAction callback

add beforeAction callback

--- src/coffee/controller.coffee
+++ src/coffee/controller.coffee
@@ -5,7 +5,7 @@
   layout:        false

   constructor: (@params = {}) ->
-    @_afterInitialize()
+    @_afterInitialize() if @_afterInitialize?

   # Callbacks

@@ -26,6 +26,7 @@
     else
       throw new Error "No route found for #{@constructor.name}##{action}"

+    @_beforeAction() if @_beforeAction?
     @_render action.call(this)

   _getRoute: (route) ->


Add reload and toggle dev tools key bindings to test window

Signed-off-by: Max Brunsfeld <78036c9b69b887700d5846f26a788d53b201ffbb@github.com>

--- src/initialize-test-window.coffee
+++ src/initialize-test-window.coffee
@@ -1,14 +1,10 @@
 # Start the crash reporter before anything else.
 require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub')

-path = require 'path'
+try
+  path = require 'path'
+  ipc = require 'ipc'

-
-ipc = require 'ipc'
-ipc.send('call-window-method', 'openDevTools')
-
-
-try
   require '../src/window'
   Atom = require '../src/atom'
   window.atom = new Atom
@@ -16,6 +12,15 @@
   # Show window synchronously so a focusout doesn't fire on input elements
   # that are focused in the very first spec run.
   atom.getCurrentWindow().show() unless atom.getLoadSettings().headless
+
+  window.addEventListener 'keydown', (event) ->
+    # Reload: cmd-r / ctrl-r
+    if (event.metaKey or event.ctrlKey) and event.keyCode is 82
+      ipc.send('call-window-method', 'restart')
+
+    # Toggle Dev Tools: cmd-alt-i / ctrl-alt-i
+    if (event.metaKey or event.ctrlKey) and event.altKey and event.keyCode is 73
+      ipc.send('call-window-method', 'toggleDevTools')

   # Add 'exports' to module search path.
   exportsPath = path.join(atom.getLoadSettings().resourcePath, 'exports')


Forgot a newline

Forgot a newline

Signed-off-by: Ian Macalinao <08370e385f4778cad8fe504ec5445edd3d45bd9a@gmail.com>

--- src/items/hextech_gunblade.coffee
+++ src/items/hextech_gunblade.coffee
@@ -20,4 +20,4 @@
   active:
     unique: yes
     cd: 60
-    desc: "Deals 150 + 40% of your ability power as magic damage and slows the target champion's movement speed by 40% for 2 seconds."+    desc: "Deals 150 + 40% of your ability power as magic damage and slows the target champion's movement speed by 40% for 2 seconds."


Automatically update images on room page.

--- client/room/room.coffee
+++ client/room/room.coffee
@@ -1,6 +1,7 @@
 Template.room_controls.helpers
   thumbnail: ->
-    room = @_id
+    roomId = @_id
+    timestamp = @imageTimestamp or 0
     switch Session.get 'view'
       when 'view-screen'
         file = 'screen.jpg'
@@ -8,7 +9,7 @@
         file = 'presenter.jpg'
       when 'view-galicaster'
         file = 'presentation.jpg'
-    "/image/#{room}/#{file}"
+    "/image/#{roomId}/#{file}?#{timestamp}"

 Template.room_controls.events
   'click .peakaboo-command': (e) ->


simplify code

simplify code


try reactive variable for client state

try reactive variable for client state

--- client/ts_client.coffee
+++ client/ts_client.coffee
@@ -45,3 +45,7 @@
   return unless turkserver

   Session.set("turkserver.state", turkserver.state)
+
+# Reactive variables for state
+TurkServer.inLobby = ->
+  Session.equals("turkserver.state", "lobby")


fuck you david

fuck you david

--- src/lib/client/opened_apps.coffee
+++ src/lib/client/opened_apps.coffee
@@ -73,6 +73,11 @@
   get_firebase_value: () ->
     return 1

+to_firebase_dict: (apps) ->
+  dict = {}
+  for app in apps
+    dict[app.get_firebase_key()] = app.get_firebase_value()
+  return dict

 module.exports =
   # list of strings, list of {window_index, tab_index, tab_url}
@@ -80,10 +85,4 @@
     native_apps = _filter_and_fetch_apps_from_titles(app_titles)
     tab_apps = _filter_and_fetch_tabs(tab_objects)

-    return native_apps.concat(tab_apps)
-
-  to_firebase_dict: (apps) ->
-    dict = {}
-    for app in apps
-      dict[app.get_firebase_key()] = app.get_firebase_value()
-    return dict
+    return to_firebase_dict(native_apps.concat(tab_apps))


JInvitation: remove existing invitations of removed member both for kick/leave [completes #106298826]

--- workers/social/lib/social/models/invitation.coffee
+++ workers/social/lib/social/models/invitation.coffee
@@ -279,3 +279,22 @@
     name = "#{name} #{lastName}"  if firstName and lastName

     return name
+
+
+  do ->
+
+    JGroup = require './group'
+
+    JGroup.on 'MemberRemoved', ({ member, group }) ->
+
+      return  unless member or group
+      return  if group.slug in ['guests', 'koding']
+
+      member.fetchUser (err, user) ->
+        return log 'Failed to fetch member:', err  if err or not user
+
+        JInvitation.remove {
+          email     : user.email
+          groupName : group.slug
+        }, (err) ->
+          log 'Failed to remove existing invitations', err  if err


JUser: send warning to old email, just before updating it [completes #87341792]

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -1061,10 +1061,7 @@
           callback createKodingError "Email is already in use!"
         else
           user.changeEmail account, options, callback
-          if account.status is 'registered'
-            # don't send an email when guests change their emails, which we
-            # need to allow for the pricing workflow.
-            sendChangeEmail user.email, "email"
+

   @emailAvailable = (email, callback)->
     @count {email}, (err, count)->
@@ -1141,17 +1138,25 @@

       JVerificationToken.confirmByPin options, (err, confirmed)=>

-        if err then callback err
-        else if confirmed
-          @update $set: {email}, (err, res)=>
-            if err
-              callback err
-            else
-              account.profile.hash = getHash email
-              account.save (err)-> throw err if err
-              callback null
-        else
-          callback createKodingError 'PIN is not confirmed.'
+        return callback err  if err
+
+        unless confirmed
+          return callback createKodingError 'PIN is not confirmed.'
+
+        oldEmail = @getAt 'email'
+
+        @update $set: {email}, (err, res)=>
+
+          return callback err  if err
+
+          account.profile.hash = getHash email
+          account.save (err)=>
+
+            unless err
+              sendChangedEmail @getAt('username'), oldEmail, 'email'
+
+            callback err
+

   fetchHomepageView:(options, callback)->
     {account, bongoModels} = options


workers: extract tracker related into own functions

--- workers/social/lib/social/models/user/index.coffee
+++ workers/social/lib/social/models/user/index.coffee
@@ -1607,18 +1607,6 @@
           queue.next()

       ->
-        JUser.emit 'UserRegistered', { user, account }
-        queue.next()
-
-      ->
-        # Auto confirm accounts for development environment or Teams ~ GG
-        options = { group : client.context.group, user, email, username }
-        confirmAccountIfNeeded options, (err, pin_) ->
-          return callback err  if err
-          pin = pin_
-          queue.next()
-
-      ->
         date = new Date 0
         subscription =
           accountId          : account.getId()
@@ -1634,51 +1622,22 @@
         queue.next()

       ->
-        return queue.next()  if disableCaptcha
-
-        jwtToken = JUser.createJWT { username }
-
-        { status, lastLoginDate } = user
-        { createdAt } = account.meta
-
-        sshKeysCount = user.sshKeys.length
-
-        emailFrequency =
-          global       : user.emailFrequency.global
-          marketing    : user.emailFrequency.marketing
-
-        traits = {
-          email
-          createdAt
-          lastLoginDate
-          status
-
-          firstName
-          lastName
-
-          subscription
-          sshKeysCount
-          emailFrequency
-
-          pin
-          jwtToken
-        }
-
-        Tracker.identify username, traits
-        Tracker.alias oldUsername, username
+        args = { user, account, subscription, pin, oldUsername }
+        identifyUserOnRegister disableCaptcha, args

         queue.next()

       ->
-        return queue.next()  if disableCaptcha
-
-        subject             = Tracker.types.START_REGISTER
-        { username, email } = user
-
-        opts = { pin, email, group: client.context.group, user : { user_id : username, email } }
-        Tracker.track username, { to : email, subject }, opts
-
+        JUser.emit 'UserRegistered', { user, account }
         queue.next()
+
+      ->
+        # Auto confirm accounts for development environment or Teams ~ GG
+        options = { group : client.context.group, user, email, username }
+        confirmAccountIfNeeded options, (err, pin_) ->
+          return callback err  if err
+          pin = pin_
+          queue.next()

       ->
         # don't block register
@@ -1686,12 +1645,68 @@
         queue.next()

       ->
+        group = client.context.group
+        trackUserOnRegister disableCaptcha, { user, group, pin }
+
+        queue.next()
+
+      ->
         SiftScience = require '../siftscience'
         SiftScience.createAccount client, referrer, ->

     ]

     daisy queue
+
+
+  identifyUserOnRegister = (disableCaptcha, args) ->
+
+    return  if disableCaptcha
+
+    { user, account, subscription, pin, oldUsername } = args
+    { status, lastLoginDate, username, email } = user
+    { createdAt, profile } = account.meta
+    { firstName, lastName } = account.profile
+
+    jwtToken = JUser.createJWT { username }
+
+    sshKeysCount = user.sshKeys.length
+
+    emailFrequency =
+      global       : user.emailFrequency.global
+      marketing    : user.emailFrequency.marketing
+
+    traits = {
+      email
+      createdAt
+      lastLoginDate
+      status
+
+      firstName
+      lastName
+
+      subscription
+      sshKeysCount
+      emailFrequency
+
+      pin
+      jwtToken
+    }
+
+    Tracker.identify username, traits
+    Tracker.alias oldUsername, username
+
+
+  trackUserOnRegister = (disableCaptcha, args) ->
+
+    return  if disableCaptcha
+
+    subject              = Tracker.types.START_REGISTER
+    { user, group, pin } = args
+    { username, email }  = user
+
+    opts = { pin, email, group, user : { user_id : username, email } }
+    Tracker.track username, { to : email, subject }, opts

   @createJWT: (data, options = {}) ->


fix regression tests for new wording

fix regression tests for new wording

--- test/lib/user.iced
+++ test/lib/user.iced
@@ -303,9 +303,10 @@

   follow : (followee, {remote}, cb) ->
     esc = make_esc cb, "User::follow"
-    eng = @keybase_expect [ "track", followee.username ]
-
-    eng.expect { pattern : /Are you satisfied with these proofs\? \[y\/N\] / }, (err, data, src) ->
+    un = followee.username
+    eng = @keybase_expect [ "track", un ]
+
+    eng.expect { pattern : new RegExp("Is this the #{un} you wanted\\? \\[y\\/N\\] ") }, (err, data, src) ->
       unless err?
         await followee.check_proofs eng.stderr().toString('utf8'), defer err
         if err?


fix(FileDownloadStore): delete download from @_downloads after @trigger

--- src/flux/stores/file-download-store.coffee
+++ src/flux/stores/file-download-store.coffee
@@ -231,8 +231,8 @@

   _cleanupDownload: (download) ->
     download.abort()
+    @trigger()
     delete @_downloads[download.fileId]
-    @trigger()

   _defaultSavePath: (file) ->
     if process.platform is 'win32'


Show page tear effect on 1+ nested elements instead of 2+

--- src/form_components/repeating_group.coffee
+++ src/form_components/repeating_group.coffee
@@ -123,7 +123,7 @@
     @$el.html JST['partials/repeating_group'](@)

     @$el.removeClass('is_truncated')
-    if (@model.entries.length && @model.entries[0].formComponents.length > 1)
+    if (@model.entries.length && @model.entries[0].formComponents.length > 0)
       @$el.addClass('is_truncated')

     rivets.bind @$el, { @model }


resolve correctly; hide the doc-view correctly

--- lib/atom-ternjs-autocomplete.coffee
+++ lib/atom-ternjs-autocomplete.coffee
@@ -48,6 +48,7 @@
                         return
                     if data.completions.length is 1 and data.completions[0].name.replace('$', '') is prefix
                         resolve(that.suggestionsArr)
+                        that.documentationView.hide()
                         return
                     for obj, index in data.completions
                         if index == maxItems


fix checkins - re-render view on change:checkins

--- www/src/views/quest/checkins.coffee
+++ www/src/views/quest/checkins.coffee
@@ -17,4 +17,8 @@
             enabled: "checkin" in (@model.get("tags") || [])
             isOwned: @model.isOwned()

+        initialize: ->
+            super
+            @listenTo @model, "change:checkins", @render
+
         features: ['timeago']


removed rename from item-view context menu

--- menus/tree-view.cson
+++ menus/tree-view.cson
@@ -91,7 +91,6 @@
   ]

   'atom-pane[data-active-item-path] .item-views': [
-    {'label': 'Rename', 'command': 'tree-view:rename'}
     {'label': 'Reveal in Tree View', 'command': 'tree-view:reveal-active-file'}
   ]


Check on mounting if image is already loaded.

Server rendered pages often have images that are already loading
which breaks the retina replacement as previously we only used the
onLoad event to check if we needed to replace the image.

--- src/index.cjsx
+++ src/index.cjsx
@@ -41,6 +41,7 @@

   componentDidMount: ->
     @checkForRetina()
+    @checkLoaded()

   componentDidUpdate: ->
     @checkForRetina()
@@ -87,6 +88,21 @@

       @setState retinaCheckComplete: true

+  # For server-rendered code, sometimes images will already be loaded by the time
+  # this module mounts.
+  # http://stackoverflow.com/a/1977898
+  checkLoaded: ->
+    el = @refs.img.getDOMNode()
+
+    unless el.complete
+      return false
+
+    if el.naturalWidth is 0
+      return false
+
+    # No other way to disprove it's loaded so we'll assume it's ok.
+    @handleOnLoad()
+

   handleOnLoad: (e) ->
     # Customers of component might care when the image loads.


Remove unused variable

Remove unused variable

--- build/tasks/publish-build-task.coffee
+++ build/tasks/publish-build-task.coffee
@@ -8,7 +8,6 @@
 request = require 'request'

 grunt = null
-maxReleases = 10
 assets = [
   {assetName: 'atom-mac.zip', sourceName: 'Atom.app'}
   {assetName: 'atom-mac-symbols.zip', sourceName: 'Atom.breakpad.syms'}


:guardsman: Add a try..catch block in markRange

--- lib/minimap-git-diff-binding.coffee
+++ lib/minimap-git-diff-binding.coffee
@@ -58,10 +58,13 @@
     @markers = null

   markRange: (startRow, endRow, scope) ->
-    marker = @editor.markBufferRange([[startRow, 0], [endRow, Infinity]], invalidate: 'never')
-    @minimapView.decorateMarker(marker, type: 'line', scope: scope)
-    @markers ?= []
-    @markers.push(marker)
+    try
+      marker = @editor.markBufferRange([[startRow, 0], [endRow, Infinity]], invalidate: 'never')
+      @minimapView.decorateMarker(marker, type: 'line', scope: scope)
+      @markers ?= []
+      @markers.push(marker)
+    catch e
+      console.warn 'markRange failed', e.stack

   destroy: ->
     @removeDecorations()


:bug: Fix deprecations with master Atom

:bug: Fix deprecations with master Atom

--- lib/minimap-pigments-binding.coffee
+++ lib/minimap-pigments-binding.coffee
@@ -11,8 +11,13 @@

     @colorBuffer.initialize().then => @updateMarkers()

-    @subscriptions.add @colorBuffer.editor.displayBuffer.onDidTokenize =>
-      @updateMarkers()
+    if @colorBuffer.editor.onDidTokenize?
+      @subscriptions.add @colorBuffer.editor.onDidTokenize =>
+        @updateMarkers()
+    else
+      @subscriptions.add @colorBuffer.editor.displayBuffer.onDidTokenize =>
+        @updateMarkers()
+
     @subscriptions.add @colorBuffer.onDidUpdateColorMarkers =>
       @updateMarkers()


Fix for <count>F.

Fix for <count>F.

We were immediately restarting link-hints mode if a count was present.
Unfortunately, that meant that we were detecting our own link-hint click
and exiting immediately.  So, with a count of 6, we were only getting 3
link-hint activations.

To avoid this, we add a short delay (just nextTick).

Also, move some other stuff arund to make sure this works in all cases
(e.g. wait-for-enter).

--- content_scripts/link_hints.coffee
+++ content_scripts/link_hints.coffee
@@ -26,7 +26,9 @@
         # can exit following which we do not restart hints mode.
         return if event?.type == "keydown" and KeyboardUtils.isEscape event
         return if event?.type == "keydown" and event.keyCode in [ keyCodes.backspace, keyCodes.deleteKey ]
-        LinkHints.activateMode count-1, mode
+        # Wait for the next tick to allow the previous mode to exit.  It might yet generate a click event,
+        # which would cause our new mode to exit immediately.
+        Utils.nextTick -> LinkHints.activateMode count-1, mode

   activateModeToOpenInNewTab: (count) -> @activateMode count, OPEN_IN_NEW_BG_TAB
   activateModeToOpenInNewForegroundTab: (count) -> @activateMode count, OPEN_IN_NEW_FG_TAB
@@ -389,11 +391,10 @@
         @linkActivator(clickEl)
         LinkHints.activateModeWithQueue() if @mode is OPEN_WITH_QUEUE

-      delay = 0 if waitForEnter
-      @deactivateMode delay, =>
-        if waitForEnter
-          new WaitForEnter @matchedLink.rect, linkActivator
-        else
+      if waitForEnter
+        new WaitForEnter @matchedLink.rect, => @deactivateMode 0, linkActivator
+      else
+        @deactivateMode delay, =>
           DomUtils.flashRect @matchedLink.rect
           linkActivator()

@@ -421,18 +422,16 @@
       @onExit?()
       @onExit = null
       @tabCount = 0
+      callback?()

     if delay
       # Install a mode to block keyboard events if the user is still typing.  The intention is to prevent the
       # user from inadvertently launching Vimium commands when typing the link text.
-      new TypingProtector delay, @matchedLink?.rect, ->
-        deactivate()
-        callback?()
+      new TypingProtector delay, @matchedLink?.rect, deactivate
     else
       # We invoke deactivate() directly (instead of setting a timeout of 0) so that deactivateMode() can be
       # tested synchronously.
       deactivate()
-      callback?()

 # Use characters for hints, and do not filter links by their text.
 class AlphabetHints


coach should mount after summary, as opposed to before quizes, which dont always exist on every non-intro page

--- src/scripts/modules/media/body/body.coffee
+++ src/scripts/modules/media/body/body.coffee
@@ -96,15 +96,16 @@

       $exercisesToHide

-    makeRegionForCoach: ($exercises, wrapperId = 'coach-wrapper') ->
+    makeRegionForCoach: ($summary, wrapperId = 'coach-wrapper') ->
       $("##{wrapperId}").remove()
       $coachWrapper = $("

")
-      $coachWrapper.insertBefore(_.first($exercises))
+      $coachWrapper.insertAfter(_.last($summary))

     handleCoach: ($el) ->
       return unless @isCoach()
-      $hiddenExercises = @hideExercises($el)
-      @makeRegionForCoach($hiddenExercises) if $hiddenExercises.length > 0
+      @hideExercises($el)
+      $summary = $el.find('.summary, .section-summary')
+      @makeRegionForCoach($summary) if $summary.length > 0

     # Toggle the visibility of teacher's edition elements
     toggleTeacher: () ->


Expose constant

Expose constant

--- lib/Acho.coffee
+++ lib/Acho.coffee
@@ -5,11 +5,9 @@
 DEFAULT  = require './Default'
 CONST    = require './Constants'

-
 Acho = (opts = {}) ->
   return new Acho opts unless this instanceof Acho

-  # TODO: Merge instead of clonee
   acho = Object.assign({}, DEFAULT(), opts)
   acho.diff = [] if acho.diff

@@ -33,12 +31,5 @@

   acho

-# TODO: Remove it, unnecessary
-Acho.skin = (skinFn) ->
-  skin = skinFn(CONST)
-  (opts = {}) ->
-    Acho(Object.assign({}, opts, skin))
-
-Acho.defaults = DEFAULT
-
 module.exports = Acho
+module.exports.constants = CONST


agda-mode:give

agda-mode:give

--- lib/agda.coffee
+++ lib/agda.coffee
@@ -111,7 +111,7 @@
       positions = @holeManager.holes.map (hole) =>
         start = hole.getStart()
         hole.translate start, 3
-
+
       positions.forEach (position) =>
         if position.isLessThan cursor
           previousGoal = position
@@ -130,20 +130,19 @@

   atGoal: ->
     cursor = @editor.getCursorBufferPosition()
-    goals = @editor
-      .findMarkers type: 'hole'
-      .filter (marker) =>
-        marker.bufferMarker.range.containsPoint cursor
+    goals = @holeManager.holes.filter (hole) =>
+       hole.getRange().containsPoint cursor
+
     # in certain hole
     if goals.length is 1
-
-      index = goals[0].getAttributes().index
-      start = goals[0].getStartBufferPosition().translate new Point 0, 2
-      startIndex = @editor.getBuffer().characterIndexForPosition start
-      end = goals[0].getEndBufferPosition().translate new Point 0, -2
-      endIndex = @editor.getBuffer().characterIndexForPosition end
-      content = @editor.getTextInBufferRange new Range(start, end)
-
+      goal = goals[0]
+      index = goal.index
+      start = goal.getStart()
+      startIndex = goal.toIndex start
+      end = goal.getEnd()
+      endIndex = goal.toIndex end
+      text = goal.getText()
+      content = text.substring(2, text.length - 2)
       command = "IOTCM \"#{@filepath}\" NonInteractive Indirect \
         (Cmd_give #{index} (Range [Interval (Pn (Just (mkAbsolute \
         \"#{@filepath}\")) #{startIndex} #{start.row + 1} #{start.column + 1})\


add open command

add open command

--- lib/dobi.coffee
+++ lib/dobi.coffee
@@ -116,7 +116,10 @@

   # open a site
   when 'open'
-    exit 'not available yet'
+    url = 'http://www.lessthan3.com'
+    url += "/#{arg}" for arg in args
+    open url
+    exit()

   # run a development server
   when 'run'


interval = 1800

interval = 1800

--- lib/init.coffee
+++ lib/init.coffee
@@ -360,7 +360,7 @@
     autoRefreshEl = document.getElementById('lupa-refresh')
     if value
         autoRefreshEl.style.display = 'none'
-        refreshInterval = setInterval(refresh, 800)
+        refreshInterval = setInterval(refresh, 1800)
     else
         clearInterval(refreshInterval)
         autoRefreshEl.style.display = 'block'


Made status regexes case-insensitive.

Made status regexes case-insensitive.

--- prviewer.coffee
+++ prviewer.coffee
@@ -159,7 +159,7 @@
           if comments.length
             body = comments[comments.length - 1].body
             for config in settings.statuses
-              if new RegExp(config.regex).test body
+              if new RegExp(config.regex, 'i').test body
                 pull.statusClass = config.class
                 pull.status = config.title
                 break


Fix. Refs #7.

Fix. Refs #7.

--- src/spec/integration/streaming.spec.coffee
+++ src/spec/integration/streaming.spec.coffee
@@ -14,7 +14,7 @@
         apiClient.delete cat
       .then (results) ->
         resolve results
-    .catch (err)
+    .catch (err) ->
       reject err

 describe 'Streaming', ->


update new device min version

update new device min version

--- framer/Components/DeviceComponent.coffee
+++ framer/Components/DeviceComponent.coffee
@@ -635,8 +635,8 @@
 ###########################################################################
 # DEVICE CONFIGURATIONS

-newDeviceMinVersion = 51
-oldDeviceMaxVersion = 50
+newDeviceMinVersion = 52
+oldDeviceMaxVersion = 51

 iPadAir2BaseDevice =
 	deviceImageWidth: 1856


create_mixin function

create_mixin function

--- system/core/Meta.coffee
+++ system/core/Meta.coffee
@@ -154,29 +154,35 @@
     for $key, $val of defineClass($mixin)
       $properties[$key] = $val

-  # or just merge simple tables?
-  if not $class?
-    switch $args.length
-      when 0
-        # simple case -
-        #   just clone the object
-        return create($object)
-      when 1
-        # optimized case -
-        #   merge object with object
-        $args[0].__proto__ = $object
-        return create($args[0])
+  # no class was encountered
+  if $class?
+    # clone the object with all properties
+    $this = create($object, $properties)
+    # call the constructor
+    $class.apply $this, $args[$pos..]
+    $this

-    # build a merged properties table
-    for $data in $args
-      for $key in getOwnPropertyNames($data)
-        $properties[$key] = getOwnPropertyDescriptor($data, $key)
+  else switch $args.length
+    when 0
+      # simple case -
+      #   just clone the object
+      create($object)

-  # clone the object with all properties
-  $this = create($object, $properties)
-  # if there was a constructor, call it
-  $class.apply $this, $args[$pos..] if $class
-  $this
+    when 1
+      # optimized case -
+      #   merge object with object
+      $args[0].__proto__ = $object
+      create($args[0])
+
+    else
+      # optimized case -
+      #   merge object with object
+      for $i in [1...$args.length]
+        $args[$i-1] = $args[$i].__proto__
+      $args[$args.length-1].__proto__ = $object
+      create($args[0])
+
+

 #  ------------------------------------------------------------------------
 #


[IMPAC-598] Add option for full length thresholds

--- src/services/highcharts-factory/highcharts-factory.svc.coffee
+++ src/services/highcharts-factory/highcharts-factory.svc.coffee
@@ -90,15 +90,20 @@
       # Determine the indexes length of the cash projection intervals
       projectionIntervalLength = @data.labels.slice(todayIndex(@data.labels), @data.labels.length).length
       for threshold in options.thresholds
+        data = if options.fullLengthThresholds then [] else new Array(@data.labels.length - projectionIntervalLength).fill(null)
         serie =
           name: 'Threshold KPI'
           kpiId: threshold.kpiId
-          data: new Array(@data.labels.length - projectionIntervalLength).fill(null)
+          data: data
           color: _.get(options, 'thresholdsColor', 'rgba(255, 0, 0, 0.5)')
           showInLegend: false
           marker: { enabled: false }
-        # Set the thresholds for the projection intervals, creating a horizontal bar
-        thresholdBar = _.map(new Array(projectionIntervalLength), -> parseFloat(threshold.value))
+        if options.fullLengthThresholds
+          # Set the thresholds for all intervals, creating a full length horizontal bar
+          thresholdBar = _.map(@data.labels, -> parseFloat(threshold.value))
+        else
+          # Set the thresholds for the projection intervals, creating a horizontal bar
+          thresholdBar = _.map(new Array(projectionIntervalLength), -> parseFloat(threshold.value))
         serie.data.push.apply(serie.data, thresholdBar)
         # Note: series can only be added after initial render via the `addSeries` method.
         @hc.addSeries(serie, true)


fix(tap): unbind handlers on destroy

fix(tap): unbind handlers on destroy

--- modules/scripts/directives/tap.coffee
+++ modules/scripts/directives/tap.coffee
@@ -12,3 +12,6 @@
     element.bind 'tap', (e, touch) ->
       scope.$apply $parse(attrs.bpTap), {$event: e, touch}
       false
+
+    scope.$on '$destroy', ->
+      element.unbind 'tap'


Add descriptions for config settings

Add descriptions for config settings

--- lib/main.coffee
+++ lib/main.coffee
@@ -3,24 +3,28 @@
     showIcons:
       type: 'boolean'
       default: true
+      description: 'Show icons in tabs for panes which define an icon, such as the Settings and Project Find Results.'
     alwaysShowTabBar:
       type: 'boolean'
       default: true
-      description: "Shows the Tab Bar when only 1 tab is open"
+      description: 'Show the tab bar even when only one tab is open.'
     tabScrolling:
       type: 'boolean'
       default: process.platform is 'linux'
+      description: 'Jump to next or previous tab by scrolling on the tab bar.'
     tabScrollingThreshold:
       type: 'integer'
       default: 120
+      description: 'Threshold for switching to the next/previous tab when the `Tab Scrolling` config setting is enabled. Higher numbers mean that a longer scroll is needed to jump to the next/previous tab.'
     usePreviewTabs:
       type: 'boolean'
       default: false
-      description: 'Tabs will only stay open if they are modified or double-clicked'
+      description: 'Tabs will only stay open if they\'re double-clicked or their contents is modified.'
     enableVcsColoring:
       title: "Enable VCS Coloring"
       type: 'boolean'
       default: false
+      description: 'Color file names in tabs based on VCS status, similar to how file names are colored in the tree view.'

   activate: (state) ->
     state = [] unless Array.isArray(state)


:art: Fix a typo

:art: Fix a typo

--- lib/main.coffee
+++ lib/main.coffee
@@ -39,7 +39,7 @@
       type: 'string'
       default: 'Left'
     ignoredMessageTypes:
-      title: "Ignored Error Types"
+      title: "Ignored message Types"
       type: 'array'
       default: []
       items:


fix #50 prevent vim-mode-plus command become available in mini editor

--- lib/main.coffee
+++ lib/main.coffee
@@ -57,7 +57,7 @@
     getState = =>
       @getEditorState(atom.workspace.getActiveTextEditor())

-    scope = 'atom-text-editor'
+    scope = 'atom-text-editor:not([mini])'
     for name, fn of vimStateCommands
       do (fn) =>
         @subscribe atom.commands.add scope, "#{packageScope}:#{name}", (event) ->


fix bug not detecting ISCC; update description

--- lib/main.coffee
+++ lib/main.coffee
@@ -11,7 +11,7 @@
   config:
     pathToISCC:
       title: "Path To ISCC"
-      description: "Specify the full path to `ISCC.exe`"
+      description: "Specify the full path to `ISCC.exe`. On first compile, the package will run `#{which} ISCC` in order to detect it."
       type: "string"
       default: ""
   subscriptions: null
@@ -44,7 +44,7 @@

       @getPath (stdout) ->
         isccBin  = atom.config.get('language-innosetup.pathToISCC')
-        if !isccBin?
+        if not isccBin
           atom.notifications.addError("**language-innosetup**: no valid `ISCC.exe` was specified in your config", dismissable: false)
           return

@@ -61,7 +61,7 @@
   getPath: (callback) ->
     # If stored, return pathToISCC
     pathToISCC = atom.config.get('language-innosetup.pathToISCC')
-    if pathToISCC?
+    if pathToISCC
       callback pathToISCC
       return