This file contains 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
export function faunaDocToObject (item) { | |
if (Array.isArray(item)) { | |
return item.map(itemArray => faunaDocToObject(itemArray)); | |
} | |
if (item && typeof item === 'object') { | |
const object = {}; |
This file contains 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 groups = app.activeDocument.layerSets; | |
var first = parseInt(groups[0].name); | |
for (var i = 0; i < groups.length; i++) { | |
var groupName = first + i; | |
groups[i].name = groupName; | |
var layers = groups[i].artLayers; |
This file contains 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 groups = app.activeDocument.layerSets; | |
var first = parseInt(groups[0].name); | |
for (var i = 1; i < groups.length; i++) { | |
groups[i].name = first + i; | |
} |
This file contains 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 faunadb = require('faunadb'); | |
const q = faunadb.query; | |
const client = new faunadb.Client({ | |
secret: 'YOUR_FAUNA_SECRET' | |
}); | |
async function countDocs () { | |
const refs = []; | |
let after, page; |
This file contains 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 activeLayerRef = app.activeDocument.activeLayer; | |
if (activeLayerRef.artLayers) { | |
var layers = activeLayerRef.artLayers; | |
for (var i = 0; i < layers.length; i++) { | |
layers[i].name = activeLayerRef.name + '_' + (i+1); | |
} | |
} |
This file contains 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
// All FQL commands | |
const { | |
Abort, Abs, Acos, Add, All, And, Any, Append, Asin, At, Atan, BitAnd, BitNot, BitOr, BitXor, Call, Casefold, Ceil, Collection, Collections, Concat, Contains, ContainsStr, ContainsStrRegex, Cos, Cosh, Count, Create, CreateCollection, CreateDatabase, CreateFunction, CreateIndex, CreateKey, CreateRole, Database, Databases, Date, DayOfMonth, DayOfWeek, DayOfYear, Degrees, Delete, Difference, Distinct, Divide, Do, Documents, Drop, EndsWith, Epoch, Equals, Events, Exists, Exp, Filter, FindStr, FindStrRegex, Floor, Foreach, Format, Function, Functions, GT, GTE, Get, HasIdentity, Hour, Hypot, Identify, Identity, If, Index, Indexes, Insert, Intersection, IsArray, IsBoolean, IsBytes, IsCollection, IsCredentials, IsDatabase, IsDate, IsDoc, IsDouble, IsEmpty, IsFunction, IsIndex, IsInteger, IsKey, IsLambda, IsNonEmpty, IsNull, IsNumber, IsObject, IsRef, IsRole, IsSet, IsString, IsTimestamp, IsToken, Join, KeyFromSecret, Keys, LT, LTE, LTrim, Lambda, Length, Let, Ln, Log, Login, Logout, Lower |
This file contains 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
[ | |
{"code":"A1", "name":"Anonymous Proxy", "region":"NO_REGION"}, | |
{"code":"A2", "name":"Satellite Provider", "region":"NO_REGION"}, | |
{"code":"O1", "name":"Other Country", "region":"NO_REGION"}, | |
{"code":"AD", "name":"Andorra", "region":"EUROPE"}, | |
{"code":"AE", "name":"United Arab Emirates", "region":"MIDDLE_EAST"}, | |
{"code":"AF", "name":"Afghanistan", "region":"MIDDLE_EAST"}, | |
{"code":"AG", "name":"Antigua and Barbuda", "region":"CARIBBEAN"}, | |
{"code":"AI", "name":"Anguilla", "region":"CARIBBEAN"}, | |
{"code":"AL", "name":"Albania", "region":"EUROPE"}, |
This file contains 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
// init | |
const fastify = require('fastify')({ | |
ignoreTrailingSlash: true, | |
logger: true | |
}); | |
fastify.route({ | |
method: 'GET', | |
url: '/', | |
handler: (request, reply) => { |
This file contains 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 routesFilesPlugin = { | |
name: 'route-files', | |
buildStart: async (options) => { | |
console.log('Generating routeModules.js'); | |
const routesDir = path.resolve(__dirname, 'src/components/routes'); | |
const routeFiles = fs.readdirSync(routesDir); | |
const routesString = routeFiles.map((filename) => { |