Skip to content

Instantly share code, notes, and snippets.

View modster's full-sized avatar
🧠

EM Greeff modster

🧠
View GitHub Profile
@modster
modster / ZonePlus.lua
Created October 16, 2021 18:29
ZonePlus Example
-- https://1foreverhd.github.io/ZonePlus/
-- Assuming we place ZonePlus in ReplicatedStorage
local Zone = require(game:GetService("ReplicatedStorage").Zone)
local container = workspace.SafeZoneContainer
local zone = Zone.new(container)
zone.playerEntered:Connect(function(player)
print(("%s entered the zone!"):format(player.Name))
@modster
modster / preload.js
Created November 14, 2021 09:50
Electron preload process
// All of the Node.js APIs are available in the preload process.
// It has the same sandbox as a Chrome extension.
// The process.versions property returns an object listing the version
// strings of Node.js and its dependencies. process.versions.modules
// indicates the current ABI version, which is increased whenever a
// C++ API changes. Node.js will refuse to load modules that were compiled
// against a different module ABI version.
const { versions } = require('process')
@modster
modster / svg.md
Last active November 15, 2021 03:33
SVG.MD

markdown

Alt text

@modster
modster / sanitize-true.md
Last active November 15, 2021 03:43
Append ?sanitize=true

?sanitze=true

@modster
modster / base-octocat.md
Last active April 3, 2022 17:05
base-octocat.svg

This is an image

![This is an image](https://myoctocat.com/assets/images/base-octocat.svg)
@modster
modster / app.js
Created November 16, 2021 03:19 — forked from ArunMichaelDsouza/app.js
Woodlot middlewareLogger config
var express = require('express');
var app = express();
var woodlot = require('woodlot').middlewareLogger;
app.use(woodlot({
streams: ['./logs/app.log'],
stdout: false,
routes: {
whitelist: ['/api', '/dashboard'],
strictChecking: false
@modster
modster / GraphQL.md
Created November 16, 2021 05:41
Using GraphQL in a Browser

Using GraphQL in a Browser

GraphQL.js is a general-purpose library and can be used both in a Node server and in the browser. As an example, the GraphiQL tool is built with GraphQL.js!

Building a project using GraphQL.js with webpack or rollup should just work and only include the portions of the library you use. This works because GraphQL.js is distributed with both CommonJS (require()) and ESModule (import) files. Ensure that any custom build configurations look for .mjs files!

@modster
modster / schema.js
Created November 16, 2021 07:13
Define a simple API with express-graphql
// https://graphql.org/graphql-js/express-graphql/#graphqlhttp
// import { graphqlHTTP } from 'express-graphql'; // ES6
var { graphqlHTTP } = require('express-graphql'); // CommonJS
graphqlHTTP({
schema: GraphQLSchema,
graphiql?: ?boolean,
rootValue?: ?any,
context?: ?any,
@modster
modster / Passing-Arguments.md
Created November 16, 2021 07:55
Express and GraphQL API Passing Arguments

Passing Arguments

Just like a REST API, it's common to pass arguments to an endpoint in a GraphQL API. By defining the arguments in the schema language, typechecking happens automatically. Each argument must be named and have a type. For example, in the Basic Types documentation we had an endpoint called rollThreeDice: