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
| var https = require('https'); | |
| //Setting max sockets did the thing for me | |
| https.globalAgent.maxSockets = 99999999999; | |
| https.request.timeout = 60000; | |
| var options = { //setting options..host,port,path etc.. | |
| host: 'roads.googleapis.com', | |
| //timeout: 60000, | |
| port: 443, | |
| path: '/v1/snapToRoads?path=' + trackString + '&interpolate=true&key=' + key, |
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
| var key = 'YOUR-KEY'; | |
| //Setting maxSockets to fix econnreset issue | |
| var separateReqPool = {maxSockets: 9999999}; | |
| var url = 'https://roads.googleapis.com/v1/snapToRoads?key='+key+'&interpolate=true&path=' + trackString; | |
| request.get({ | |
| url: url, json: true, pool: separateReqPool | |
| }, function (err, r, b) { | |
| console.log(err, b); | |
| }); |
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
| {url:'stun:stun01.sipphone.com'}, | |
| {url:'stun:stun.ekiga.net'}, | |
| {url:'stun:stun.fwdnet.net'}, | |
| {url:'stun:stun.ideasip.com'}, | |
| {url:'stun:stun.iptel.org'}, | |
| {url:'stun:stun.rixtelecom.se'}, | |
| {url:'stun:stun.schlund.de'}, | |
| {url:'stun:stun.l.google.com:19302'}, | |
| {url:'stun:stun1.l.google.com:19302'}, | |
| {url:'stun:stun2.l.google.com:19302'}, |
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
| import java.io.FileDescriptor; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.io.PrintStream; | |
| public class HelloWorld{ | |
| private static HelloWorld instance; | |
| public static void main(String[] args){ | |
| instantiateHelloWorldMainClassAndRun(); |
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
| package utils | |
| import ( | |
| "runtime" | |
| "github.com/Sirupsen/logrus" | |
| ) | |
| // DecorateRuntimeContext appends line, file and function context to the logger | |
| func DecorateRuntimeContext(logger *logrus.Entry) *logrus.Entry { |
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
| //Usage - toBinaryString("\xd4!")) ==> 110101000010000100100000 | |
| func toBinaryString(str string) string { | |
| bitstring := "" | |
| for i := 0; i < len(str); i++ { | |
| for bit := 7; bit >= 0; bit-- { | |
| set := (str[i]>>uint(bit))&1 == 1 | |
| if set { | |
| bitstring += "1" | |
| } else { |
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
| # Add alias for zsh shell | |
| echo "alias json='python -mjson.tool'" >> ~/.zshrc | |
| # Add alias to bash shell | |
| echo "alias json='python -mjson.tool'" >> ~/.bashrc |
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
| curl -v -F "@file=template-document-hx.doc" host:port/path/to/server |
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
| ➜ dist kafka-topics --list --zookeeper localhost:2181 | |
| shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory | |
| shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory | |
| shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory | |
| Error occurred during initialization of VM | |
| java.lang.Error: Properties init: Could not determine current working directory. | |
| at java.lang.System.initProperties(Native Method) | |
| at java.lang.System.initializeSystemClass(System.java:1166) |
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
| TypeError: unsupported operand type(s) for *: 'NoneType' and 'int' |
OlderNewer