Skip to content

Instantly share code, notes, and snippets.

View biggora's full-sized avatar
💭
I may be slow to respond.

Aleksejs Gordejevs biggora

💭
I may be slow to respond.
View GitHub Profile
@biggora
biggora / mailru.js
Created March 26, 2012 08:46
Mail.ru OAuth module for everyauth
var oauthModule = require('./oauth2')
, url = require('url')
, crypto = require('crypto');
var mailru = module.exports =
oauthModule.submodule('mailru')
.configurable({
display: 'set to "mobile" if you want users to see a mobile optimized version of the auth page',
scope: 'specify types of access: See http://api.mail.ru/docs/guides/restapi/#permissions'
})
/*
A little node.js server for testing html5 ajax file uploads.
It serves up the current directory and receives uploads at /upload.
This is for use with xhr.send(file) where the entire request body is the file.
It just pauses one second between chunks so that client-side progress events
get a chance to fire. On my laptop it looks like the maximum chunk size is
around 40K, so you would still need images in the range of hundreds of kilobytes
to really be able to test it.
@biggora
biggora / 0_reuse_code.js
Created October 14, 2013 20:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@biggora
biggora / session.js
Created January 19, 2014 18:21
Add session store in TrinteJS
/**
* Default session configuration
* Inject app and express reference
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var config = require('./configuration');
@biggora
biggora / local.js
Last active January 3, 2016 19:38
Local Authorization in TrinteJS
/**
* Local Authorization manager
*
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var auth = require( 'trinte-auth' );
@biggora
biggora / UserModelHelper.js
Created February 16, 2014 15:07
User Model Helper Example, Define Custom Methods and Fields Valididation.
/**
* User Model Helper
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var crypto = require('crypto');
var checkEmail = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i;
@biggora
biggora / uploader.js
Created August 17, 2014 08:22
Example uploading files middleware for TrinteJS framework
/**
* Upload manager
*
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var Uploader = require('express-uploader');
var defaultOptions = {
@biggora
biggora / recaptcha.js
Created August 17, 2014 08:29
Recaptcha usage for TrinteJS framework
/**
* Recaptcha builder
*
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var Recaptcha = require('recaptcha').Recaptcha;
var config = require("../configuration");
@biggora
biggora / mailer.js
Created August 17, 2014 08:36
Nodemail usage for TrinteJS framework
/**
* Mail manager
*
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var nodemailer = require("nodemailer");
var config = require("../configuration");
@biggora
biggora / cart.js
Created August 17, 2014 08:56
Shopping cart for TrinteJS framework
/**
* Shopping Cart manager
*
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
exports.addProductToCart = function addProductToCart() {