This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| suite("Metric"); | |
| test(".getDataLabels returns all data epochs as human readable dates", function() { | |
| var labels, metric; | |
| metric = new Metric({ | |
| data: [ | |
| { date: 1388793600 }, | |
| { date: 1391472000 } | |
| ] | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <link rel="stylesheet" href="/js/test_libs/css/mocha.css"> | |
| <title>Client Tests</title> | |
| </head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Backbone.Controllers.PostsController extends Backbone.Diorama.Controller | |
| constructor: -> | |
| @mainRegion = new Backbone.Diorama.ManagedRegion() | |
| $('body').append(@mainRegion.$el) | |
| # Start state | |
| @index() | |
| index: => | |
| postCollection = new Backbone.Collection.PostCollection() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Somewhat copied from https://github.com/spf13/spf13-vim/blob/master/.vimrc | |
| set nocompatible " We're running Vim, not Vi! | |
| call pathogen#runtime_append_all_bundles() " add pathogen | |
| " UI stuff | |
| syntax on " Enable syntax highlighting | |
| set background=dark " Assume a dark background | |
| color ir_black | |
| set backspace=indent,eol,start " backspace for dummys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Crazy Slow | |
| UPDATE protected_areas SET criteria = 'Not Applicable' WHERE designation_id != 5; | |
| # Near instant | |
| UPDATE protected_areas SET criteria = 'Not Applicable' | |
| FROM protected_areas AS pa | |
| LEFT OUTER JOIN designations ON pa.designation_id = designations.id | |
| WHERE designations.id = 5 AND pa.designation_id = NULL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typeof(some_var) // returns 'undefined' | |
| //Therefore, the correct way in javascript to check if a variable has a value is: | |
| typeof some_var === 'undefined' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| undefined = "don't ever do this"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (some_var === undefined) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var some_var; | |
| some_var === null; // false | |
| some_var == null; // true | |
| some_var; // undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // from | |
| if (some_var == null | |
| // to | |
| if (some_var === null) |