Skip to content

Instantly share code, notes, and snippets.

View kuryaki's full-sized avatar
🏠
Working from home

David Roncancio kuryaki

🏠
Working from home
View GitHub Profile
@kuryaki
kuryaki / gist:4149443
Created November 26, 2012 17:14
javascript to run bash
Node File
---------------
#!/usr/bin/node
var spawn = require('child_process').spawn,
ls = spawn('./testBash');
ls.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
@kuryaki
kuryaki / comparepubatom
Created November 27, 2012 03:18
Compare data received from pubsub and atom suscription
pubsubhub information:
{
"after": "0943e7a820de29f6a223a5b23c0dc8531a3e280a",
"before": "7db933f0405d0d94a267a7021856c8ec032229f0",
"commits": [
{
"added": [
"config.js"
],
@kuryaki
kuryaki / gist:5817093
Created June 19, 2013 19:12
Stanza Error
<message from="+573105805315@test.twnel.net" to="+573014311354@test.twnel.net/16319533291371668128292844" type="error" messageType="plain" fromName="bbva" serviceType="opcallcenter" date="Wed, 19 Jun 2013 18:56:46 GMT" xmlns:stream="http://etherx.jabber.org/streams"><body>test</body><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></message>
@kuryaki
kuryaki / gist:6875876
Last active December 24, 2015 22:49
HTTP streams with node
//SERVER
var http = require('http');
http.createServer(function (req, res) {
req.on('data', function(chunk) {
console.log('server received: ' + chunk);
res.write(chunk);
});
@kuryaki
kuryaki / gist:7474407
Created November 14, 2013 21:12
small start API project
/*
test/someTest.js
*/
'use strict';
require('should');
var supertest = require('supertest');
var app = require('../app');
var request = supertest(app);
@kuryaki
kuryaki / gist:8273927
Created January 5, 2014 21:11
Dynamic Router with express ??
var http = require('http')
, express = require('express');
var app = express();
var controllers = [
{
method: 'get',
path: '/',
exec: function(req, res) {
# You will need to make this file executable (chmod u+x) and run it with sudo
apt-get -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
mkdir -p /src/erlang
cd /src/erlang
wget http://www.erlang.org/download/otp_src_R15B.tar.gz
tar -xvzf otp_src_R15B.tar.gz
chmod -R 777 otp_src_R15B
cd otp_src_R15B
./configure
make
var object = {"hola":"mundo", "data":""}
var objectBuffer = new Buffer(JSON.stringify(object))
console.log(objectBuffer.length) // this should be 26 OK
var data0 = new Buffer('normal', 'utf-8')
console.log(data0.length) // this should be 6 OK
var data1 = new Buffer('"normal', 'utf-8') // Note extra double quote (it only happends with double quotes weird characters like ó work ok)
console.log(data1.length) // this should be 7 OK

Keybase proof

I hereby claim:

  • I am kuryaki on github.
  • I am kuryaki (https://keybase.io/kuryaki) on keybase.
  • I have a public key whose fingerprint is 7085 92C8 321B FF55 AB93 C105 9369 B713 C74D 8D29

To claim this, I am signing this object:

### Payload
#### Simple text notification for patient or provider
```
{
to: '234',
sender: '987',
text: 'You have a visit scheduled',