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 alphabeticalSort = function(array) { | |
| return array.sort(function(a, b) { | |
| var A = a.toLowerCase(); | |
| var B = b.toLowerCase(); | |
| if (A < B) { | |
| return -1; | |
| } else if (A > B) { | |
| return 1; | |
| } else { | |
| return 0; |
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
| /* Have to set height explicity on ui-view | |
| to prevent collapsing during animation*/ | |
| [ui-view] { | |
| padding-top: 55px; | |
| height: 100%; | |
| } | |
| .ui-view-container { | |
| position: relative; | |
| } |
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 x = function(x, y) { | |
| /** code */ | |
| }; | |
| x.toString() | |
| .replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s))/mg,'') | |
| .match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1] | |
| .split(/,/) |
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
| module.exports = [ | |
| { | |
| country: 'United States of America (+1)', | |
| "code": "1" | |
| }, { | |
| country: 'Canada (+1)', | |
| "code": "1" | |
| }, { | |
| country: 'Russia (+7)', | |
| "code": "7" |
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
| // Usage | |
| var React = require('react'); | |
| var TabPanel = require('./TabPanel.jsx'); | |
| var MyTabPanel = React.createClass({ | |
| mixins: [TabPanel], | |
| getDefaultProps: function() { | |
| return { |
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
| HTMLElement.prototype.empty = function() { | |
| Array.prototype.slice.call(this.children).forEach(function(child) { | |
| this.removeChild(child); | |
| }.bind(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
| /* Smartphones (portrait and landscape) ----------- */ | |
| @media only screen | |
| and (min-device-width : 320px) | |
| and (max-device-width : 480px) { | |
| /* Styles */ | |
| } | |
| /* Smartphones (landscape) ----------- */ | |
| @media only screen | |
| and (min-width : 321px) { |
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 fs = require('fs'); | |
| var path = require('path'); | |
| var env = process.env.NODE_ENV; | |
| var configFile = path.resolve(__dirname, './environments/'+env+'.json'); | |
| var config = JSON.parse(fs.readFileSync(configFile)); | |
| Object.keys(config).forEach(function(key) { | |
| process.env[key] = config[key]; | |
| }); |
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
| function Json2CSV(objArray) | |
| { | |
| var | |
| getKeys = function(obj){ | |
| var keys = []; | |
| for(var key in obj){ | |
| keys.push(key); | |
| } | |
| return keys.join(); | |
| }, objArray = format_json(objArray) |