Skip to content

Instantly share code, notes, and snippets.

View jure's full-sized avatar

Jure Triglav jure

View GitHub Profile
@bumi
bumi / yjs-pg-server.js
Created March 20, 2020 10:04
implementation of a websocket server storing yjs documents in a postgresql database
const WebSocket = require('ws');
const http = require('http');
const Y = require('yjs');
const wsUtils = require('./utils');
const cookie = require('cookie');
const QuillDelta = require('quill-delta');
//const QuillConverter = require('node-quill-converter');
//const MdastFromQuillDelta = require('mdast-util-from-quill-delta');
@bellbind
bellbind / custom-nodejs-howto.md
Last active August 20, 2020 03:10
[nodejs]How to use your custom build binaries of nodejs

Custom nodejs build howto

TLDR:

  • How to make "custom" nodejs build
  • How to use custom build node via nvm
  • How to use custom build npm for native packages

What is "custom" build

Feb 10, 2016

Mediately is growing and we're looking for a Ruby/Python backend engineer!

We are developers of a medical information mobile app. It's targeted at doctors and other medical professionals, and our users love us. More than half of all doctors in Slovenia use the app daily and we are the market leader in all 4 countries we have apps in. And this year we're growing to 3 more, so we need you!

We do not require a full-stack unicorn who knows everything from AWS to CSS, we're looking for someone to help us maintain and build on our backend. Its job is to automatically combine information from websites and docs and build local databases. Your job will be to help us do this faster in new countries, automate as much as possible and further develop internal tools for getting insights out of these databases. It would be great if you have experience in text and data mining and if you find natural language processing interesting you will love the potential our databases have.

Our sources are in all Europe

@lackofdream
lackofdream / pmspi.py
Last active July 10, 2018 06:51
Raspberry Pi and PMS5003
import serial
import datetime
from pymongo import MongoClient
port = serial.Serial('/dev/ttyAMA0', baudrate=9600, timeout=2.0)
client = MongoClient('172.31.150.230')
def read_pm_line(_port):
rv = b''
@nnarhinen
nnarhinen / README.md
Last active June 25, 2019 09:33
Rails-like console with express.js, bookshelf.js and node-repl-promised

Install node-repl-promised: npm install -g repl-promised

Use the repl to list all users

$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@mathisonian
mathisonian / index.md
Last active March 22, 2023 05:31
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@timoxley
timoxley / gist:1721593
Created February 2, 2012 04:58
Recursively run all tests in test directory using mocha
// this will find all files ending with _test.js and run them with Mocha. Put this in your package.json
"scripts": {
"test": "find ./tests -name '*_test.js' | xargs mocha -R spec"
},