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
// ****Copy and paste in script tags in an empty HTML page**** | |
// | |
// - When you click on a button it turns into an input field, | |
// - you can edit the text and press "enter" to switch back | |
// - to a button | |
// | |
$(document).on('ready', function() { | |
// Make buttons and append it to the DOM | |
$('body').prepend('<button class="button">This is a Button!</button>'); |
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
// | |
// Custom event - counter | |
// Emits data: startTime, startCount & count | |
// | |
var emitCounter= function(){ | |
var currentCount = 0, | |
date = new Date(), | |
startTime = date.getTime(); |
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 store = new JSData.DS(); | |
store.registerAdapter('http', new DSHttpAdapter(), { default: true }); | |
var User = store.defineResource({ | |
name : 'user', | |
bypassCache : true, | |
relations: { |
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
Warning: React can't find the root component node for data-reactid value `.5.1`. If you're seeing this message, it probably means that you've loaded two copies of React on the page. At this time, only a single copy of React can be loaded at a time.warning @ bundle.js:60215ReactMount.findComponentRoot @ bundle.js:52740ReactMount.findReactNodeByID @ bundle.js:52707getNode @ bundle.js:52190executeDispatch @ bundle.js:44197executeDispatchesInOrder @ bundle.js:44221executeDispatchesAndRelease @ bundle.js:43664executeDispatchesAndReleaseTopLevel @ bundle.js:43675forEachAccumulated @ bundle.js:57576EventPluginHub.processEventQueue @ bundle.js:43880runEventQueueInBatch @ bundle.js:51159ReactEventEmitterMixin.handleTopLevel @ bundle.js:51175handleTopLevelWithoutPath @ bundle.js:51273handleTopLevelImpl @ bundle.js:51253Mixin.perform @ bundle.js:57058ReactDefaultBatchingStrategy.batchedUpdates @ bundle.js:49890batchedUpdates @ bundle.js:55134ReactEventListener.dispatchEvent @ bundle.js:51384 | |
bundle.js:52743 Uncaught Typ |
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
/* | |
Create and attach | |
*/ | |
var el; | |
el = document.createElement('div'); | |
el.id = "MyReactModalView"; | |
document.getElementsByTagName('body')[0].appendChild(el); | |
ReactDOM.render(<MyReactModalView />, document.querySelector('#MyReactModalView')); |
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
Report | |
.find({where: {users: "562ed24a11ea954b36f20f74" }}) | |
.populate('users') | |
.exec(function (err, reports) { | |
console.log(reports); | |
}); |
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 = { | |
attributes: { | |
users : { | |
type : 'json', | |
defaultsTo : [] | |
} |
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
/* | |
This will create a file and trigger a download for the user. | |
*/ | |
var a = window.document.createElement('a'); | |
a.href = window.URL.createObjectURL(new Blob(['This is the text in the file..'], {type: 'text/html'})); | |
a.download = 'filename_test.html'; | |
// Append anchor to body. | |
document.body.appendChild(a) |
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
/** | |
* HTTP Server Settings | |
* (sails.config.http) | |
* sails_project/config/http.js | |
* | |
* Sails.js v.11.* | |
*/ | |
module.exports.http = { |
OlderNewer