Skip to content

Instantly share code, notes, and snippets.

<posxmlapplication xmlns="http://tempuri.org/posxml.xsd">
<page name="principal">
<stringvariable value="" variable="primeiravez" />
<stringvariable value="" variable="ModeloTerminal" />
<stringvariable value="" variable="ModeloAbreviado" />
<stringvariable value="" variable="VersaoFramework" />
<integervariable value="3" variable="int_return" />
<stringvariable value="" variable="str_return" />
<readfile filename="config.dat" key="primeiravez" variabledestination="$(primeiravez)" />
package org.scaloid.hello
import org.scaloid.common._
import android.graphics.Color
import org.jamruby.core.Jamruby;
import org.jamruby.mruby.MRuby;
import org.jamruby.mruby.ParserState;
import org.jamruby.mruby.Value;
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <ctype.h>
#include "bencode.h"
#define MAX_ALLOC (((size_t) -1) / sizeof(struct bencode *) / 2)
@luisbebop
luisbebop / httpbenchmark.go
Last active May 6, 2016 12:36
http benchmark tool
import (
"flag"
"fmt"
"net/http"
)
var (
n = flag.Int("n", 100, "number of GETs to run")
s = flag.Bool("s", false, "whether to use HTTPS")
c = flag.Bool("c", false, "whether to run concurrently")
module Crc16
def crc16_hex(buf)
crc = crc16(buf)
# to swap the number just invert the order of the indexes [0..1] and [2..3]
"#{crc.to_s(16).rjust(4,"0")[0..1]}#{crc.to_s(16).rjust(4,"0")[2..3]}".upcase
end
def crc16(buf, crc=0)
buf.each_byte{|x| crc = ((crc<<8) ^ CCITT_16[(crc>>8) ^ x])&0xffff}
@luisbebop
luisbebop / gist:783509
Created January 17, 2011 21:19
ssl socket with verix
//tcp ssl
if(strcmp(UCLprotocol, "TCP") == 0 && withSSL)
{
handleSocket = socket(AF_INET, SOCK_STREAM | SOCK_SSL, 0);
if(handleSocket >= 0)
{
if((strcmp(UCLmedia, "ETHERNET")) == 0)
{
timeout.tv_sec = 5;
timeout.tv_usec = 100;
@luisbebop
luisbebop / gist:783505
Created January 17, 2011 21:16
ssl with verix ethernet
AppObject = CreateAppObj(4); // for ETHERNET
//terminais Vx510 6A2 com modem ethernet comum ou Vx510 11A1 com modem ethernet interno USB
if (SVC_INFO_MODULE_ID(3) == 22)
comnObj = uclFactory->Create(COM3, &ret, (ApplicationObj *)AppObject,ETHERNET);
else
comnObj = uclFactory->Create(COM_ETH1, &ret, (ApplicationObj *)AppObject,ETHERNET);
// utilizado camada IP/PPP em DIAL, GPRS, GSM suportados pelas rotinas da biblioteca UCL
ret = AssignUcltoTCP(comnObj, timer, 20000, 60000, 30000, 15000, 6000, 6000);
# where do you want couchdb and its deps to be installed
COUCHDB_PREFIX=/opt/couchdb-1.0.0
# download, chmod and install
curl "http://dl.couchone.com/dl/20e4ab59869fc48828db075f7c000c70/couchdb-1.0.0_1-linux-x64-installer.bin" -O
echo "`curl http://dl.couchone.com/dl/_design/dl/_show/sha1/20e4ab59869fc48828db075f7c000c70 --silent` couchdb-1.0.0_1-linux-x64-installer.bin" | sha1sum --check -
chmod u+x couchdb-1.0.0_1-linux-x64-installer.bin
./couchdb-1.0.0_1-linux-x64-installer.bin --prefix $COUCHDB_PREFIX --mode unattended
# link into /etc/init.d/couchdb and setup couchdb for auto-startup
From 991801b97297ac5047f42412e2d5ef3eb7bab0d8 Mon Sep 17 00:00:00 2001
From: luisbebop <luisbebop@gmail.com>
Date: Thu, 29 Jul 2010 15:02:58 -0300
Subject: [PATCH] Implemented W3C CORS on httpd interface. Closes COUCHDB-832
---
src/couchdb/couch_httpd.erl | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl