Skip to content

Instantly share code, notes, and snippets.

View jfromaniello's full-sized avatar
😀
coding

José F. Romaniello jfromaniello

😀
coding
View GitHub Profile
@jfromaniello
jfromaniello / server.js
Last active December 10, 2015 18:58
error_domains.js
//npm install express request mongodb connect-domain connect-mongodb
var request = require('request'),
express = require('express'),
connectDomain = require('connect-domain'),
http = require('http');
var MongoStore = require('connect-mongodb'),
Db = require('mongodb').Db,
Server = require('mongodb').Server,
Date.fake(new Date(2019, 0 , 1))
var a = new Date(); // Tue Jan 01 2019 00:00:00 GMT-0300 (ART)
Date.unfake();
a.getTime() === new Date(2019, 0, 1).getTime() //true
@jfromaniello
jfromaniello / example.js
Created November 27, 2012 15:08
another twist in javascript partial application. Bind
var salutator = {
name: 'jose',
greet: function(greeting, person) {
console.log(greeting + ' ' + person + '. ' + this.name + ' salutates you.');
}
};
salutator.greet('hello', 'Mark');
//hello mark, jose salutates you.
@jfromaniello
jfromaniello / gist:4087861
Last active February 6, 2022 03:53
socket-io.client send the cookies!
/*
* Little example of how to use ```socket-io.client``` and ```request``` from node.js
* to authenticate thru http, and send the cookies during the socket.io handshake.
*/
var io = require('socket.io-client');
var request = require('request');
/*
* This is the jar (like a cookie container) we will use always
prompt: Is this ok?: (yes)
info: Creating snapshot 0.0.0-40
info Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: Unhandled error
error: at Object.onError (/root/nodejitsu/lib/nodejitsu.js:75:48)
error: at Router.invoke (/root/nodejitsu/node_modules/flatiron/node_modules/director/lib/director/router.js:359:18)
error: at /root/nodejitsu/node_modules/flatiron/node_modules/director/lib/director/router.js:47:9
info: Creating snapshot 0.0.1-36
info Uploading: [=============================] 99%
info: Updating app nodejs-workshop
info: Activating snapshot 0.0.1-36 for nodejs-workshop
info: Starting app nodejs-workshop
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy the app
error:
error: Rackspace Error (404): Item not found
using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Data.Services.Common;
using System.Linq;
namespace TestSingly
{
public class SinglyServices : DataService<SinglyContext>
{
{
"_id": "26d6b393987a9346d98b8efe35065e83",
"_rev": "2-b317e63d8b2e4622be7aa59b95d2183f",
"status": "fail",
"payload": {
"pusher": {
"name": "none"
},
"repository": {
"name": "workshopba",
info it worked if it ends with ok
verbose cli [ 'C:\\Program Files (x86)\\nodejs\\\\node.exe',
verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
verbose cli 'install',
verbose cli 'ws',
verbose cli '-g' ]
info using npm@1.1.24
info using node@v0.6.19
verbose C:\Program Files (x86)\nodejs\\node.exe node symlink
verbose config file C:\Users\cs\.npmrc
for rate in 1..5
.rate-{rate}
span:nth-child(-n+{rate})::after
content: "★"
span:nth-child(n+{rate+1})::after
content: "☆"