Skip to content

Instantly share code, notes, and snippets.

{
"sample": {
"valid": ["PK123123","OI2123123","haha"],
"no_result": ["))kjjkkdf","**kjkljsdf"],
"bad_format": ["&^&^*^*&*","()()()():P"]
},
"test": {
"basic_test":
{
"expect":
@dg3feiko
dg3feiko / gist:0a8d26afd51eb0123db1
Created January 20, 2015 05:20
simple express server
var express = require('express');
var app = express();
app.post('/', function (req, res, next) {
/**
* Created by FeikoLai on 13/1/15.
*/
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
function getFile(url) // returns a promise
{
return Promise.delay(3000) //Promise.delay() returns a promise
.then(function(){
return http.download('url') // http.download returns a promise
})
}
var dbs = require('dbs');
//registeration
dbs.newStore("Address",{
"config"
{
{
"id": "UUID_Version 5",
"user_id":"USER_ID",
"status": "complete",
"created_at":"2015-04-09T07:36:05+00:00",
"updated_at":"2015-04-09T07:49:05+00:00",
"req":
{
"non_queryable_attribute1":..
"non_queryable_attribute2":..
{
"id": "UUID_Version 5",
"user_id":"USER_ID",
"created_at":"2015-04-09T07:36:05+00:00",
"updated_at":"2015-04-09T07:49:05+00:00",
"attribute1":"",
"attribute2":"",
"attribute3":""
}
var search = module.exports.search = function search(object, path, acc_path) {
if (typeof path === "string") {
path = path.split(".");
}
if (!(path instanceof Array) || path.length === 0) {
return;
}
path = path.slice();
@dg3feiko
dg3feiko / redis-trib.rb
Created May 20, 2015 03:31
redis-trib.rb
#!/usr/bin/env ruby
# TODO (temporary here, we'll move this into the Github issues once
# redis-trib initial implementation is completed).
#
# - Make sure that if the rehashing fails in the middle redis-trib will try
# to recover.
# - When redis-trib performs a cluster check, if it detects a slot move in
# progress it should prompt the user to continue the move from where it
# stopped.

command

while true; do curl -o /dev/null -s -w %{time_total} https://dynamodb.us-east-1.amazonaws.com ;sleep 1; echo; done;

from west-2