This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies. | |
var express = require('express') | |
app = module.exports = express.createServer(), | |
del = function(req, res) { res.clearCookie('login_token'); res.redirect('/'); }, | |
set = function(req, res) { res.cookie('login_token', +new Date(), { maxAge: 3600000, path: '/' }); res.redirect('/'); }; | |
// Config | |
app.configure(function() { | |
app.use(express.bodyParser()); | |
app.use(express.cookieParser()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class Person | |
Private m_Age | |
Private m_Name | |
Public Default Function Init(Name, Age) | |
m_Name = Name | |
m_Age = Age | |
Set Init = Me | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attribute VB_Name = "ModStdIO" | |
Option Explicit | |
Private Declare Function GetStdHandle Lib "kernel32" (ByVal nStdHandle As Long) As Long | |
Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, _ | |
lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, _ | |
lpNumberOfBytesRead As Long, lpOverlapped As Any) As Long | |
Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, _ | |
lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, _ | |
lpNumberOfBytesWritten As Long, lpOverlapped As Any) As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The MIT License | |
Copyright 2014 Sony Mobile Communications AB. All rights reserved. | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use waterfall so that you can easily disconnect at the end of your code. | |
// It also makes node.js callbacks less confusing. | |
async.waterfall([ | |
function (wCb) { | |
connection.connect(); | |
// wCB is a callback function. Call it when you want to move to the | |
// next function in the waterfall | |
wCb(); | |
}, | |
function (wCB) { |