Skip to content

Instantly share code, notes, and snippets.

View reggi's full-sized avatar
🌺
Learning

Reggi reggi

🌺
Learning
View GitHub Profile
@reggi
reggi / gist:3461039
Created August 25, 2012 05:02
Nested Requests
exports.index = function(req, res){
var request = require("request");
var gist = "https://api.github.com/gists/public?page=1&per_page=1";
request(
{
url: gist,
json:true
/Users/thomas/Desktop/git/socket.io-on-dotcloud/app/app.js:74
clouds[socket.id].socket.emit('progress', {pourcent: pourcent});
^
TypeError: Cannot read property 'socket' of undefined
at Socket.exec (/Users/thomas/Desktop/git/socket.io-on-dotcloud/app/app.js:74:24)
at Socket.EventEmitter.emit (events.js:88:17)
at Pipe.onread (net.js:395:14)
25 Aug 01:20:35 - [nodemon] app crashed - waiting for file changes before starting...
@reggi
reggi / gist:3532063
Created August 30, 2012 16:14
Mongo
{
"transactions": [
{
"amount": "10.00",
"authorization": null,
"created_at": "2012-08-24T14:02:50-04:00",
"gateway": "bogus",
"id": 999225661,
"kind": "capture",
"order_id": 450789469,
@reggi
reggi / config.js
Created August 31, 2012 16:22
Include node variables from another config file.
module.exports = function(){
var limit = 250;
var Mongolian = require("mongolian");
var server = new Mongolian();
var db = server.db("shop");
var orders = db.collection("orders");
}
@reggi
reggi / first try
Created October 19, 2012 20:17
Mongo output while trying to connect to server from local computer.
thomas@workstation:~$ mongo mongodb://username:[email protected]:27017/database
MongoDB shell version: 2.0.6
connecting to: mongodb://username:[email protected]:27017/database
Fri Oct 19 16:16:28 Assertion failure _setName.size() client/../db/../client/dbclient.h 156
0x100079aa3 0x10007b29c 0x1000b91c2 0x1000f90c7 0x10015d512 0x10015e115 0x100150883 0x10015cda9 0x10011279b 0x100107fc2 0x10001fef7 0x1000e912f 0x100008458 0x10000aaca 0x100001454
0 mongo 0x0000000100079aa3 _ZN5mongo12sayDbContextEPKc + 195
1 mongo 0x000000010007b29c _ZN5mongo8assertedEPKcS1_j + 300
2 mongo 0x00000001000b91c2 _ZN5mongo16ConnectionString5parseERKSsRSs + 2130
3 mongo 0x00000001000f90c7 _ZN5mongo26mongo_external_constructorEP9JSContextP8JSObjectjPlS4_ + 263
4 mongo 0x000000010015d512 js_Invoke + 1218
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
@reggi
reggi / option1.js
Created December 20, 2012 04:04
Callback and error handeling examples
something_async({
success:function(data){
console.log(data);
},
error:function(error){
console.log(error);
}
});
@reggi
reggi / Possible European Country Code List #1
Last active August 24, 2020 22:55
Shopify Countries - European Country Codes.
AL Albania
AD Andorra
AM Armenia
AT Austria (also sometimes OE in German-speaking countries: for "Oesterreich"
BY Belarus
BE Belgium
BA Bosnia and Herzegovina
BG Bulgaria
CH Switzerland (from Confoederatio Helvetica)
CY Cyprus
@reggi
reggi / mongo.js
Last active December 10, 2015 15:59
Mongo Update $or
db.orders.update(
{
$or: [
{"line_items.sku":"TEA-BLCK"},
{"line_items.sku":"TEA-GREEN"},
{"line_items.sku":"TEA-CHAI"}
]
},
{
$set: {
AES-128-CBC
AES-128-CFB
AES-128-CFB1
AES-128-CFB8
AES-128-CTR
AES-128-ECB
AES-128-OFB
AES-128-XTS
AES-192-CBC
AES-192-CFB