Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
import sys, getopt
from vtk import *
def main(argv):
inputfile = ''
outputfile = ''
window = 80
level = 40
{ request:
{ debugId: 1,
uri: 'https://www.okcoin.cn/api/v1/kline.do?symbol=btc_cny&type=1min&size=100',
method: 'GET',
headers:
{ host: 'www.okcoin.cn',
accept: 'application/json',
'content-type': 'application/json',
'content-length': 2 },
body: '{}' } }
{
"keys": [
{
"addr": "18tHEcuuPx57oYh6nrQgrUiHL1o9CUmjCA",
"priv": "Dados Trocados",
//Required library request (npm i request --save)
var getUSDBRL = function(callback) {
var request = require('request');
var url = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%3D%22USDBRL%22&format=json&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys';
request(url, function (error, response, body) {
if (!error && response.statusCode == 200) {
var usdbrl = JSON.parse(body).query.results.rate.Rate;
callback(usdbrl);
} else {
<?php
require_once('funcoesBanco.php');
class Usuario {
var $login;
var $nome;
var $senha;
function Usuario(){
var talib = require("talib");
module.exports = function(name, inReal, optInTimePeriod, callback) {
talib.execute({
name: name,
startIdx: 0,
endIdx: inReal.length - 1,
inReal: inReal,
optInTimePeriod: optInTimePeriod
}, function(result) {
@samuelhei
samuelhei / passport-config.js
Created August 12, 2015 14:29
Passport config for local authentication with Amazon Dynamodb
/*
Passport config for local authentication with Amazon Dynamodb
*/
var passport = require("passport");
var LocalStrategy = require('passport-local').Strategy;
var path = require('path');
var User = require(path.join(__dirname, '/class/User'));