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 IComponent | |
| { | |
| public: | |
| template<typename T> | |
| static std::shared_ptr<T> get(const std::shared_ptr<Entity>& entity) | |
| { | |
| return std::dynamic_pointer_cast<T>(entity->getComponent(T::Name())); | |
| } | |
| }; |
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 verifyLinks() { | |
| $('.post-content a').each(function(index, element) { | |
| var link = $(element); | |
| var parent = link.parent(); | |
| if(link.attr('class') || link.attr('done')) { | |
| return; | |
| } | |
| link.attr('done', 1); | |
| socket.emit('topics.checkLink', link.attr('href'), function(err, result) { |
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() { | |
| "use strict"; | |
| $(document).ready(function() { | |
| $('<iframe frameborder="0" scrolling="no" id="myFrame" width=1024 height=768 class="hidden"></iframe>') | |
| .appendTo('body'); |
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
| db.getSortedSetRange('users:joindate', 0, -1, function(err, uids) { | |
| function updateUploadedPicture(uid, next) { | |
| User.getUserFields(uid, ['picture', 'uploadedpicture'], function(err, userData) { | |
| var newPicture = userData.uploadedPicture.replace('http://coinunity.sk', ''); | |
| if(userData.uploadedPicture === userData.picture) { | |
| User.setUserField(uid, 'picture', newPicture); | |
| } |
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 goes in <head> | |
| <script type='text/javascript'> | |
| var googletag = googletag || {}; | |
| googletag.cmd = googletag.cmd || []; | |
| (function() { | |
| var gads = document.createElement('script'); | |
| gads.async = true; | |
| gads.type = 'text/javascript'; | |
| var useSSL = 'https:' == document.location.protocol; |
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 str = ''; | |
| $('.fontawesome-icon-list i.fa').each(function() { | |
| if (str.indexOf($(this)[0].outerHTML) === -1 && $(this).parent().html().indexOf('alias') === -1) | |
| str += $(this)[0].outerHTML; | |
| }); | |
| console.log(str); |
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
| for (var key in mongoModule) { | |
| // if (mongoModule.hasOwnProperty(key)) { | |
| // saveFunction(key, mongoModule); | |
| // } | |
| // } | |
| // function saveFunction(key, module) { | |
| // if (typeof module[key] === 'function') { | |
| // var oldFn = module[key]; | |
| // module[key] = async function (...args) { |
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
| router.get('/fixTopics', function(req, res) { | |
| var db = require('../database'), | |
| async = require('async'); | |
| db.getSortedSetRange('topics:tid', 0, -1, function(err, tids) { | |
| function fixTopic(tid, next) { | |
| topics.getTopicField(tid, 'mainPid', function(err, mainPid) { | |
| if (err) { | |
| return next(err); |
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 db = require('../database'); | |
| //create index on array score field, and members.value | |
| db.client.collection('test').ensureIndex({"_key": 1, "members.score": 1}, {background:true},function(err) { | |
| console.log(err); | |
| }); | |
| // this is basically getSortedSetRange('experiment', 0, 3); | |
| var pipeline = [ | |
| {$match: {_key: "experiment"}}, |
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 nconf = require('nconf'); | |
| var async = require('async'); | |
| var fs = require('fs'); | |
| nconf.file({ | |
| file: 'config.json' | |
| }); |
OlderNewer