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 fs = require('fs'); | |
| var path = require('path'); | |
| var mbgl = require('../../mapbox-gl-native/lib/mapbox-gl-native'); | |
| var request = require('request'); | |
| var url = require('url'); | |
| var SegfaultHandler = require('segfault-handler'); | |
| SegfaultHandler.registerHandler("crash.log"); | |
| var options = { |
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
| { | |
| "aerialway": { | |
| "x": 30, | |
| "y": 0, | |
| "width": 30, | |
| "height": 30, | |
| "pixelRatio": 1, | |
| "sdf": true | |
| }, | |
| "airfield": { |
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 NoDefaultProvided(object): | |
| pass | |
| def getattrd(obj, name, default=NoDefaultProvided): | |
| """ | |
| Same as getattr(), but allows dot notation lookup | |
| Discussed in: | |
| http://stackoverflow.com/questions/11975781 | |
| """ |
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 lazy(func) { | |
| var called = false; | |
| var value; | |
| var func = function() { | |
| if (!called) { | |
| value = func.apply({}, arguments); | |
| } | |
| return value; | |
| } |
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
| [ | |
| { | |
| "status": "loaded", | |
| "name": "app\/app", | |
| "linkSets": [ | |
| ], | |
| "dependencies": [ |
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
| <!doctype html> |
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
| /** | |
| * Count bytes in string | |
| * | |
| * Count and return the number of bytes in a given string | |
| * | |
| * @access public | |
| * @param string | |
| * @return int | |
| */ | |
| function getByteLen(normal_val) |
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
| from pathlib import Path | |
| # Often I create a base path that is used frequently, | |
| # such as getting files relative to a "data" directory. | |
| data_path = Path(__file__).parent.joinpath('../data').resolve() | |
| # I intuitively expected there to be a "basename" attribute. | |
| # e.g. Path(__file__).basename |
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
| from collections import namedtuple | |
| import functools | |
| import unittest | |
| # The following example is contrived and over-simplified. | |
| class Vehicle(object): | |
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
| mod.factory('DataTable', function(someInjectable) { | |
| function DataTable(rows) { | |
| // ... can use "someInjectable" here ... | |
| } | |
| // This seems like boilerplate, | |
| // but I think I'm missing something. | |
| return { | |
| create: function(rows) { | |
| return new DataTable(rows); |