Skip to content

Instantly share code, notes, and snippets.

View modster's full-sized avatar
🧠

EM Greeff modster

🧠
View GitHub Profile
@modster
modster / nodejs-tcp-example.js
Created September 15, 2018 07:35 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@modster
modster / workbench.colorCustomizations.json
Created November 18, 2019 16:49 — forked from jacklorusso/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@modster
modster / index.html
Last active November 19, 2020 20:27 — forked from solrevdev/index.html
Vue.js - gistpad - display local police info
<div id="app">
<h2>Police data for Oxfordshire</h2>
<p>Using data from <a href="https://data.police.uk/docs/method/crime-street/">https://data.police.uk/docs/method/crime-street/</a></p>
<p>Built using <a href="https://vuejs.org/">vue.js</a> and <a href="https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gistfs">gistpad</a></p>
<p>Dataset source <a href="https://data.police.uk/api/crimes-street/all-crime?poly=51.85110973276099,%20-1.4057047320491165:51.86298424914946,%20-1.1282999468928665:51.71262569681858,%20-1.1241800738459915:51.70241375059155,%20-1.3905985308772415:51.850261433101906,%20-1.4043314410334915">https://data.police.uk/api/crimes-street/all-crime?poly=51.85110973276099,%20-1.4057047320491165:51.86298424914946,%20-1.1282999468928665:51.71262569681858,%20-1.1241800738459915:51.70241375059155,%20-1.3905985308772415:51.850261433101906,%20-1.4043314410334915</a></p>
<p>Sample data: <a href="sample.json">sample.json</a></p>
<button @click="clearData">Clear data<
@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 / README.md
Created December 5, 2021 06:13 — forked from Tynael/README.md
How to use npx to run gist based scripts
@modster
modster / repl-client.js
Created December 16, 2021 01:42 — forked from TooTallNate/repl-client.js
Running a "full-featured" REPL using a net.Server and net.Socket
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
@modster
modster / .block
Created December 16, 2021 02:03 — forked from mbostock/.block
Epicyclic Gearing
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/epicyclic-gearing
@modster
modster / Grin.vue
Created January 21, 2022 23:26 — forked from C451/Grin.vue
Grin
<script>
// Grin
// Adds all necessary stuff for you.
import { Overlay } from 'trading-vue-js'
export default {
name: 'Grin',
mixins: [Overlay],
methods: {
@modster
modster / service-worker.js
Created January 30, 2022 17:59 — forked from jeffposnick/service-worker.js
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';
const express = require('express');
const htm = require('htm');
const vhtml = require('vhtml');
// create an html`` tag function for vhtml:
const html = htm.bind(vhtml);
const App = (props) => html`
<div class="app">
<h1>This is an app</h1>