This file contains hidden or 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 the entities by scanning all */ | |
/** | |
* Waiting input: | |
* @param : json filename | |
* @param : json key for entities | |
*/ | |
var fs = require('fs'); | |
var rp = require('request-promise-native') | |
var chai = require('chai'); |
This file contains hidden or 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
#!/bin/bash | |
mkdir mp3_ffmpeg | |
for i in *.mp3; do ffmpeg -i ${i} -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 "mp3_ffmpeg/${i%.*}.mp3"; done |
This file contains hidden or 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
class Conv { | |
constructor() { | |
this.messages = []; | |
this.surface = { | |
capabilities : new Map() | |
}; | |
this.closed = false; | |
} |
This file contains hidden or 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
/** | |
* Waiting input: | |
* @param : json filename | |
* @param : json key for entities | |
*/ | |
var fs = require('fs'); | |
//var file = fs.readFileSync('data/' + argv.file, 'utf8'); | |
const file = process.argv[2]; | |
const key = process.argv[3]; |
This file contains hidden or 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
FROM centos:centos7 | |
# Enable EPEL for Node.js | |
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
# Install Node.js and npm | |
RUN yum install -y npm | |
# Install bzip2 | |
RUN yum install -y bzip2 | |
# Install lib for phantom | |
RUN yum install -y freetype |
This file contains hidden or 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
//Solution to convert thrift to pojo to send back to client | |
// only some fields | |
public List<JsonObject> mapping(List<TBase> listThrift){ | |
TSerializer serializer = new TSerializer(new TSimpleJSONProtocol.Factory()); | |
ObjectMapper mapper = new ObjectMapper(); | |
for(TBase f : listThrift) { | |
myJsonList.add(mapper.readValue(serializer.toString(f), MyJsonJson.class)); | |
} | |
return myJsonList; | |
} |