Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Nigilan Palanisamy nigilan

🎯
Focusing
View GitHub Profile
@siddharthkp
siddharthkp / reactivconf-2017-proposal.md
Last active Apr 17, 2020
Building applications for the next billion users
@vlucas
vlucas / encryption.js
Last active Sep 19, 2021
Stronger Encryption and Decryption in Node.js
View encryption.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@spmason
spmason / logging.js
Created Jan 24, 2012
A simple node module that makes console.log/error/warn/debug statements log through winston (simply include at the beginning of your app)
View logging.js
'use strict';
var util = require('util'),
winston = require('winston'),
logger = new winston.Logger(),
production = (process.env.NODE_ENV || '').toLowerCase() === 'production';
module.exports = {
middleware: function(req, res, next){
console.info(req.method, req.url, res.statusCode);
@greenido
greenido / Shared-WebWorkers.html
Last active Sep 27, 2015
Shared Web Workers: Show And Tale
View Shared-WebWorkers.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Shared Web Workers: Show And Tale</title>
</head>
<body>
<h1>Shared Web Workers: Show And Tale</h1>
<article>
@romannurik
romannurik / inline_worker_with_fallback.html
Created May 24, 2011
An example of using simple inline Web Workers with a fallback for browsers that can't support this technique.
View inline_worker_with_fallback.html
<!DOCTYPE html>
<html>
<!--
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0