Skip to content

Instantly share code, notes, and snippets.

View NetOpWibby's full-sized avatar
🌿
imagine being mad, touch grass

netop://ウィビ NetOpWibby

🌿
imagine being mad, touch grass
View GitHub Profile
@vlucas
vlucas / encryption.ts
Last active June 3, 2025 10:38
Stronger Encryption and Decryption in Node.js
import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters)
const IV_LENGTH: number = 16; // For AES, this is always 16
/**
* Will generate valid encryption keys for use
* Not used in the code below, but generate one and store it in ENV for your own purposes
*/
export function keyGen() {
@nodkz
nodkz / server.js
Created February 7, 2017 08:09
Sentry/raven manual config
import path from 'path';
import express from 'express';
import { merge } from 'lodash';
import graphqlHTTP from 'express-graphql';
import PrettyError from 'pretty-error';
import expressHttpProxy from 'express-http-proxy';
import bodyParser from 'body-parser';
import raven from 'raven';
import morgan from 'morgan';
import { PORT, PUBLIC_URL } from 'config';
@bekce
bekce / README.md
Created February 13, 2017 11:46
Node.js IMAP client with parsing

This example connects to an imap server and retrieves emails

npm install imap mailparser

@electrovladyslav
electrovladyslav / emoji-code-03.js
Last active July 27, 2021 01:15
Emoji-code-03
// обычная семья
// U+1F46A
> 👪
// ZWJ-последовательность: семья (мужчина, женщина, мальчик)
// U+1F468 + U+200D + U+1F469 + U+200D + U+1F466
// 👨‍ + U+200D + 👩‍ + U+200D + 👦
> ‍👨‍👩‍👦
// ZWJ-последовательность: семья (женщина, женщина, девочка)
@rhamedy
rhamedy / fileUploadsWithBusboy.js
Last active September 15, 2024 08:22
Upload files with busboy module nodejs and expressjs
//you do not necessary need all of the following, i copy/pasted a piece from
//one of my projects.
var express = require('express');
var fs = require('fs');
var Busboy = require('busboy');
var mime = require('mime');
var https = require('https');
var querystring = require('querystring');
var router = express.Router();
import r from "rethinkdb";
import restify from "restify";
import testData from "./testData";
function addTestData(conn, tableName) {
let insertData = testData[tableName];
r.db("movie_test")
.table(tableName)
.insert(insertData)
@hubgit
hubgit / bbc-broadcasts-export-rethink.js
Last active July 22, 2019 00:53
Import BBC broadcast JSON into RethinkDB
const fs = require('fs')
const ndjson = require('ndjson')
const r = require('rethinkdb')
const rethinkdbStream = require('rethinkdb-stream')
const DB_NAME = 'bbc_broadcasts'
const TABLE_NAME = 'broadcasts'
const OUTPUT_NAME = 'broadcasts.ndjson'
r.connect().then(connection => {
@aparrish
aparrish / spacy_intro.ipynb
Last active March 14, 2025 21:43
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robophil
robophil / env-examples.md
Created April 20, 2017 14:46 — forked from ericelliott/env-examples.md
env-examples

Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).

env files look like this:

SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"

To source it:

$ source dev.env # or staging.env, or production.env, depending on where you're deploying to

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active July 20, 2025 13:22
Hyperlinks in Terminal Emulators