As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
# Config for Nginx to act as a front-end for Riak | |
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc) | |
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_) | |
# Config is in /etc/nginx/sites-available/default or somewhere like that | |
# Set up load-balancing to send requests to all nodes in the Riak cluster | |
# Replace these IPs/ports with the locations of your Riak nodes | |
upstream riak_hosts { | |
server 127.0.0.1:8098; |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
#!/bin/bash | |
# | |
# Converts LDIF data to CSV. | |
# Doesn't handle comments very well. Use -LLL with ldapsearch to remove them. | |
# | |
# 2010-03-07 | |
# [email protected] | |
# | |
# Show usage if we don't have the right params |
/** | |
* Simple outbound message launcher in Node.js | |
* | |
* You will need to have a Tropo scripting aplication set up | |
* to use this. See sample code below: | |
* | |
* message(msg, { to:number, network:"SMS" }); | |
* | |
* Save this file in your Tropo account as message.js | |
* |
/** | |
* Disables the SSL certificate checking for new instances of {@link HttpsURLConnection} This has been created to | |
* aid testing on a local box, not for use on production. | |
*/ | |
private static void disableSSLCertificateChecking() { | |
TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { | |
public X509Certificate[] getAcceptedIssuers() { | |
return null; | |
} |
So you want to build a HTML Webapp and then query your JSON Api. To avoid cross domain calls use NGINX to proxy only certain requests to the API. In my case I use the Accept: header from the HTTP request to specify return data format. If that format is application/json send it to the api, otherwise try to serve the static html. |
\,,,/ | |
(o o) | |
-----oOOo-(_)-oOOo----- | |
gremlin> g = TinkerGraphFactory.createTinkerGraph() | |
==>tinkergraph[vertices:6 edges:6] | |
gremlin> A = '1'; B = '5'; N = 3 | |
==>3 | |
gremlin> g.v(A).out.loop(1){it.loops<=N && !(it.object.id in [A,B])}.has('id',B).path | |
==>[v[1], v[4], v[5]] | |
gremlin> g.v(A).both.loop(1){it.loops<=N && !(it.object.id in [A,B])}.has('id',B).path |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
var dgram = require('dgram'); | |
var socket = dgram.createSocket('udp4'); | |
var testMessage = "[hello world] pid: " + process.pid; | |
var broadcastAddress = '255.255.255.255'; | |
var broadcastPort = 5555; | |
socket.setBroadcast(true); | |
socket.bind(broadcastPort, '0.0.0.0'); |