Skip to content

Instantly share code, notes, and snippets.

View Marginal's full-sized avatar

Jonathan Harris Marginal

View GitHub Profile
@Marginal
Marginal / outfitting1.json
Last active August 29, 2015 14:22
Proposed new schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://schemas.elite-markets.net/eddn/outfitting/1#",
"type": "object",
"additionalProperties": false,
"properties": {
"$schemaRef": {
"type": "string",
"additionalProperties": false
},
@Marginal
Marginal / outfitting_message.json
Last active August 29, 2015 14:23
Outfitting message take 3
{
"$schemaRef": "http://schemas.elite-markets.net/eddn/outfitting/1",
"header": {
"softwareName": "E:D Market Connector [Mac OS]",
"softwareVersion": "1.5.0.0",
"uploaderID": "Otis B. Driftwood"
},
"message": {
"modules": [
{
@Marginal
Marginal / shipyard.json
Created June 15, 2015 21:23
Simplified sample shipyard message
{
"$schemaRef": "http://schemas.elite-markets.net/eddn/shipyard/1",
"header": {
"uploaderID": "Otis B. Driftwood",
"softwareVersion": "1.5.0.0",
"softwareName": "E:D Market Connector [Mac OS]"
},
"message": {
"timestamp": "2015-06-12T17:05:25Z",
"systemName": "Lalande 45165",
@Marginal
Marginal / dsf2png.py
Created January 11, 2016 17:10
Extracts water v. land from an X-Plane 10 "Global Scenery" or "HD Mesh Scenery v3" DSF and saves it as a 1bpp PNG image
#!/usr/bin/python
#
# Extracts the water v land from an X-Plane 10 "Global Scenery" or "HD Mesh Scenery v3" DSF
# and saves it as a 1bpp PNG image.
#
# Requires Python 2.7 plus the numpy and PIL modules, and 7-Zip
#
# Decompression requires `brew install p7zip` on Mac, 7-Zip command line on Windows, or p7zip on linux
P7 = '/usr/local/bin/7za'
@Marginal
Marginal / commodities-v3-example.json
Last active January 23, 2016 03:09
Example message in proposed commodities v3 schema
{
"$schemaRef": "http://schemas.elite-markets.net/eddn/commodity/3",
"header": {
"softwareName": "E:D Market Connector [Mac OS]",
"softwareVersion": "2.0.5.0",
"uploaderID": "Otis B. Driftwood"
},
"message": {
"commodities": [
{
@Marginal
Marginal / shipyard-v2-example.json
Last active January 23, 2016 03:10
Example message in proposed shipyard v2 schema
{
"$schemaRef": "http://schemas.elite-markets.net/eddn/shipyard/2",
"header": {
"softwareName": "E:D Market Connector [Mac OS]",
"softwareVersion": "2.0.5.0",
"uploaderID": "Otis B. Driftwood"
},
"message": {
"ships": [
{
@Marginal
Marginal / outfitting-v2-example.json
Last active January 23, 2016 03:11
Example message in proposed outfitting v2 schema
{
"$schemaRef": "http://schemas.elite-markets.net/eddn/outfitting/2",
"header": {
"softwareName": "E:D Market Connector [Mac OS]",
"softwareVersion": "2.0.5.0",
"uploaderID": "Otis B. Driftwood"
},
"message": {
"modules": [
{
--- view.php.bak 2016-05-03 09:57:59.000000000 +0100
+++ view.php 2016-05-16 23:39:41.000000000 +0100
@@ -601,7 +601,8 @@
list($storage, $internalPath) = $this->resolvePath($path);
$target = $storage->fopen($internalPath, 'w');
if ($target) {
- list (, $result) = \OC_Helper::streamCopy($data, $target);
+ list ($count, $result) = \OC_Helper::streamCopy($data, $target);
+ \OCP\Util::writeLog('file_put_contents', sprintf('Wrote %d bytes from %s to %s: exists: %d, readable: %d, size: %d', $count, $data, $internalPath, $storage->file_exists($internalPath), $storage->isReadable($internalPath), $storage->filesize($internalPath)), \OCP\Util::INFO);
fclose($target);
--- lib/private/cache/file.php.bak 2016-05-17 02:49:25.000000000 +0100
+++ lib/private/cache/file.php 2016-05-17 14:07:34.000000000 +0100
@@ -182,6 +182,7 @@
try {
$mtime = $storage->filemtime('/' . $file);
if ($mtime < $now) {
+ \OCP\Util::writeLog('OC\Cache\File::gc', sprintf('Discarding: %s', $file), \OCP\Util::INFO);
$storage->unlink('/' . $file);
}
} catch (\OCP\Lock\LockedException $e) {
@Marginal
Marginal / Journal-v1.json
Last active September 7, 2016 12:57
journal-v1 sample messages
{
"header": {
"softwareVersion": "2.2.0.0",
"softwareName": "E:D Market Connector [Mac OS]",
"uploaderID": "HRC1"
},
"$schemaRef": "http://schemas.elite-markets.net/eddn/journal/1",
"message": {
"StarSystem": "Shinrarta Dezhra",
"Faction": "The Pilots Federation",