Skip to content

Instantly share code, notes, and snippets.

@pl77
pl77 / autoslide.py
Created December 1, 2017 21:20
A small script to automate Bodyslide mesh conversions from old Skyrim CBBE to new CBBE format.
from pywinauto.application import Application
from pywinauto.timings import TimeoutError
from pywinauto.findbestmatch import MatchError
from bs4 import BeautifulSoup
import os
import time
import json
def get_soup(filepath):
@twolfson
twolfson / README.md
Last active December 28, 2019 22:38
Node.js ORM evaluation

We are planning on building a Node.js service. Here's our evaluation of the current ORM landscape:

Last updated: May 2 2016

@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@danwit
danwit / node_acl_example.js
Created April 26, 2014 00:22
Authorization with node_acl + mongo + express
/**
* Simple node_acl example with mongoDB and expressjs
*
* Usage:
* 1. Start this as server
* 2. Play with the resoures
*
* Show all permissions (as JSON)
* http://localhost:3500/info
*
@joecliff
joecliff / cryptojs_base64_encrypt_decrypt.js
Last active March 11, 2024 08:00
An example of base64 usage in cryptojs
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
//encrypt
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
//decrypt
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
@pasupulaphani
pasupulaphani / after_res_hooks.js
Last active March 20, 2024 22:23
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
@bclinkinbeard
bclinkinbeard / referenced_mongo_json.md
Created March 15, 2013 16:56
Populating referenced collections in MongoDB from JSON files using Node.js and Mongoose

Populating referenced collections in MongoDB from JSON files using Node.js and Mongoose

I recently began working with Node and MongoDB for a small personal project, largely just to learn the technologies. One thing that is fairly simple but that I found far from obvious and lacking in concrete examples was how to populate the part of my database that used referenced collections from the sample JSON data I was starting with. This post attempts to fill that gap using the following code snippets, which are heavily commented inline. You will notice I am using the awesome Mongoose library which makes working with MongoDB very easy.

http.createServer( app ).listen( app.get( 'port' ), function() {

    mongoose.connect( 'mongodb://localhost/{YOUR_DB_NAME}' );

	var db = mongoose.connection;