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
| // Copyright 2007 Timo Bingmann <tb@panthema.net> | |
| // Distributed under the Boost Software License, Version 1.0. | |
| // (See http://www.boost.org/LICENSE_1_0.txt) | |
| // | |
| // Original link http://panthema.net/2007/0328-ZLibString.html | |
| #include <string> | |
| #include <stdexcept> | |
| #include <iostream> | |
| #include <iomanip> |
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
| @echo off | |
| setlocal | |
| call :setESC | |
| cls | |
| echo %ESC%[101;93m STYLES %ESC%[0m | |
| echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m | |
| echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m | |
| echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m |
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
| #include <boost/process.hpp> | |
| #include <iostream> | |
| #include <thread> | |
| namespace bp = boost::process; | |
| using namespace std; | |
| void parent() | |
| { | |
| cout << "[P] Started" << endl; |
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
| /* | |
| * fork.c | |
| * Experimental fork() on Windows. Requires NT 6 subsystem or | |
| * newer. | |
| * | |
| * Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org> | |
| * | |
| * Permission to use, copy, modify, and/or distribute this software for any | |
| * purpose with or without fee is hereby granted, provided that the above | |
| * copyright notice and this permission notice appear in all copies. |
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
| // Convert a wide Unicode string to an UTF8 string | |
| std::string utf8_encode(const std::wstring &wstr) | |
| { | |
| int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL); | |
| std::string strTo(size_needed, 0); | |
| WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL); | |
| return strTo; | |
| } | |
| // Convert an UTF8 string to a wide Unicode String |
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
| #ifndef _DATE_TIME_FACET__HPP__ | |
| #define _DATE_TIME_FACET__HPP__ | |
| /* Copyright (c) 2004-2005 CrystalClear Software, Inc. | |
| * Use, modification and distribution is subject to the | |
| * Boost Software License, Version 1.0. (See accompanying | |
| * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) | |
| * Author: Martin Andrian, Jeff Garland, Bart Garst | |
| * $Date$ | |
| */ |
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
| const firebase = require('firebase-admin'); | |
| var serviceAccountSource = require("./source.json"); // source DB key | |
| var serviceAccountDestination = require("./destination.json"); // destiny DB key | |
| const sourceAdmin = firebase.initializeApp({ | |
| credential: firebase.credential.cert(serviceAccountSource) | |
| }); | |
| const destinyAdmin = firebase.initializeApp({ |
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
| const _ = require('lodash'); | |
| | |
| module.exports = function(config, log, firebase) { | |
| let module = {}; | |
| const db = firebase.database(); | |
| | |
| module.loadUsers = async(ctx, next) => { | |
| let usersRef = db.ref("/users"); | |
| let limit = ctx.query.limit ? parseInt(ctx.query.limit) : 10; | |
| let orderBy = ctx.query.orderBy || 'score'; |