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
pragma solidity ^0.4.0; | |
// import the contract | |
import "github.com/sagivo/solidity-utils/contracts/lib/Dictionary.sol"; | |
// have fun | |
contract Foo { | |
// declare and use new Dictionary structure | |
using Dictionary for Dictionary.Data; | |
Dictionary.Data private dic; | |
function Foo() public view returns (uint) { |
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
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice | |
stun: | |
stun.l.google.com:19302, | |
stun1.l.google.com:19302, | |
stun2.l.google.com:19302, | |
stun3.l.google.com:19302, | |
stun4.l.google.com:19302, | |
stun.ekiga.net, | |
stun.ideasip.com, |
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 strict'; | |
const timer = function(name) { | |
var start = new Date(); | |
return { | |
stop: function() { | |
var end = new Date(); | |
var time = end.getTime() - start.getTime(); | |
console.log('Timer:', name, 'finished in', time, 'ms'); | |
} |
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
create temporary table temp (symbol varchar(255), open decimal, high decimal, low decimal, close decimal, volume varchar(255), date date ); | |
create table if not exists stocks (id serial primary key, symbol varchar(255), open decimal, high decimal, low decimal, close decimal, volume varchar(255), date date, created_at timestamp, updated_at timestamp); | |
copy temp (symbol, date, open, high, low, close, volume) from '/path/to/file.csv' with delimiter ',' csv header; | |
delete from stocks using temp where stocks.date = temp.date and stocks.symbol = temp.symbol; | |
insert into stocks (symbol, open, high, low, close, volume, date) select symbol, open, high, low, close, volume, date from temp; |
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
all: build | |
build: build_node | |
build_node: node-gyp rebuild |
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
#include <nan.h> |
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
"include_dirs" : ["<!(node -e \"require('nan')\")"] |
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
void GetBuffer(const FunctionCallbackInfo<Value>& args) { | |
char *data; | |
size_t length; | |
GetSomeBufferData(data, length); | |
MaybeLocal<Object> buffer = Nan::CopyBuffer(data, length); | |
delete []data; | |
args.GetReturnValue().Set(buffer.ToLocalChecked()); | |
} |
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
void GetBuffer(const FunctionCallbackInfo<Value>& args) { | |
char *data; | |
size_t length; | |
GetSomeBufferData(data, length); | |
MaybeLocal<Object> buffer = Nan::NewBuffer(data, length); | |
args.GetReturnValue().Set(buffer.ToLocalChecked()); | |
} |
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
var addon = require('./build/Release/addon'); | |
console.log(addon.hello('Sam')); // will print "Hello Sam" |
NewerOlder