- add respond.js to IE < 9 https://github.com/scottjehl/Respond
- make sure we use latest IE renderer available
<meta http-equiv="X-UA-Compatible" content="IE=edge"> - http://getbootstrap.com/getting-started/#support-ie10-width
<meta name="viewport" content="width=device-width, initial-scale=1">.container > .row > .col > .row > .col- make semantic col names: http://getbootstrap.com/css/#grid-less
- Learn
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
| // Add a new map to the collection | |
| var map = OfflineMap.add('Berlin') | |
| // This will not yet download it, to do so, call download on it. | |
| // It returns a promise, with done / fail / progress callbacks | |
| var download = OfflineMap.find('Berlin').download(); | |
| download.progress( updateProgressBar ); | |
| // Before downloading, you can also calculate its size | |
| var map = OfflineMap.find('Berlin'); |
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
| 'use strict'; | |
| var hoodie = require('backbone').hoodie; | |
| hoodie.extend(function(hoodie,lib, utils) { | |
| var PROFILES_STORE_KEY = '_hoodie_profiles'; | |
| var store = utils.localStorageWrapper; | |
| var api = getAllProfiles; | |
| var profiles = store.getObject(PROFILES_STORE_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
| alias corsserver="echo -e \"from SimpleHTTPServer import SimpleHTTPRequestHandler\nimport BaseHTTPServer\nclass CORSRequestHandler (SimpleHTTPRequestHandler):\n def end_headers (self):\n self.send_header('Access-Control-Allow-Origin', '*')\n SimpleHTTPRequestHandler.end_headers(self)\nif __name__ == '__main__':\n BaseHTTPServer.test(CORSRequestHandler, BaseHTTPServer.HTTPServer)\" | python" |
setup
git clone https://github.com/hoodiehq/hoodie-admin-dashboard/
cd hoodie-admin-dashboard
gco admin_dashboard_tests
npm install
bower install
grunt serve
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 requestPromise; | |
| function getCurrentState() { | |
| // prevent sending multiple GET requests to /state.json. If one is pending, return its promise | |
| if (requestPromise.isPending()) return requestPromise; | |
| requestPromise = ajaxRequestReturningPromise('GET', '/state.json'); | |
| return requestPromise; | |
| } | |
| promise1 = getCurrentState() | |
| promise2 = getCurrentState() |
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
| promise = new Promise(function (resolve, reject) { | |
| // do stuff here | |
| } | |
| promise.then(null, null, function progressHandler() { | |
| // how to get here?! | |
| }); |
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
| {"title":"Anonymous Gistbook","author":"gr2m","pages":[{"pageName":"","sections":[{"type":"text","source":"# Welcome to Gistbook!\n\n$$x = \\int_a^b{x\\mathrm{d}x}$$"},{"type":"html","source":"<div>hello</div>"},{"type":"css","source":"div {\n\n background: #333;\n}"},{"type":"javascript","source":"var _ = require('underscore');\n\n_.each([1,2,3], function(num) {\n console.log('hello');\n})"}]}],"public":true} |
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 securityWrapper(checkAllowed, original, args) { | |
| var userCtx = args.options.userCtx || { | |
| //Admin party! | |
| name: null, | |
| roles: ["_admin"] | |
| }; | |
| if (userCtx.roles.indexOf("_admin") !== -1) { | |
| return original(); | |
| } | |
| if (!checkAllowed) { |
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 PDF = require('dream-pdf') | |
| var tableData = require('./table.json') | |
| PDF.plugin(require('dream-pdf-text')) | |
| PDF.plugin(require('dream-pdf-image')) | |
| PDF.plugin(require('dream-pdf-table')) | |
| pdf = new PDF({ | |
| size: [210, 297] |