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
| void scanFolder(const char *dirName) { | |
| if (DIR *pDIR = opendir(dirName)) { | |
| while (auto entry = readdir(pDIR)) { | |
| char *fileName = entry->d_name; | |
| if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { | |
| if (isFolder(fileName)) { | |
| //found another folder scan deeper | |
| scanFolder(fileVector, fileName); | |
| } else { | |
| //found a file |
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
| /** | |
| * Platform independent isFolder check | |
| * | |
| * @param filename | |
| * @return | |
| */ | |
| bool isFolder(char *filename) { | |
| struct stat info; | |
| if (stat(filename, &info) != 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
| std::ifstream::pos_type filesize(char *filename) { | |
| std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary); | |
| return in.tellg(); | |
| } |
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
| cmake_minimum_required(VERSION 3.6) | |
| project(FerrisFileIndexer) | |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") | |
| set(SOURCE_FILES main.cpp) | |
| SET(BUILD_SHARED_LIBRARIES OFF) | |
| # Link the libraries static to make a executable which can run on non-dev machines | |
| SET(CMAKE_EXE_LINKER_FLAGS "-static") |
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 https://travis-ci.org/ for automatic testing | |
| language: go | |
| go: | |
| # Use only the latest version | |
| - tip | |
| install: | |
| # Resolve dependencies | |
| - go get -u "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
| import com.google.common.collect.ImmutableSet; | |
| import java.util.Set; | |
| import org.apache.logging.log4j.core.Appender; | |
| import org.apache.logging.log4j.core.LogEvent; | |
| import org.apache.logging.log4j.core.appender.AbstractAppender; | |
| import org.apache.logging.log4j.core.impl.Log4jLogEvent; | |
| import org.fusesource.jansi.Ansi; | |
| import org.fusesource.jansi.Ansi.Attribute; |
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
| # Eclipse stuff | |
| /.classpath | |
| /.project | |
| /.settings | |
| # netbeans | |
| /nbproject | |
| nb-configuration.xml | |
| # maven |
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
| <?php | |
| /** | |
| * App\Skin | |
| * | |
| * @property integer $id | |
| * @property string $profile_id | |
| * @property string $profile_name | |
| * @property string $skin_url | |
| * @property string $cape_url | |
| * @property boolean $slim_model |
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
| <?php | |
| class PingDomain { | |
| protected function pingDomain($domain, $port) { | |
| //https://stackoverflow.com/questions/9841635/how-to-ping-a-server-port-with-php | |
| $starttime = microtime(true); | |
| $file = fsockopen($domain, $port, $errno, $errstr, 1); | |
| $stoptime = microtime(true); | |
| $status = 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
| <?php | |
| class MinecraftSRV { | |
| protected function resolveMinecraftSRV(&$host, &$port) { | |
| if (ip2long($host) !== FALSE) { | |
| //server address is an ip - we cannot resolve ip | |
| return; | |
| } | |
| $result = dns_get_record('_minecraft._tcp.' . $host, DNS_SRV); | |
| if (count($result) > 0) { |