Skip to content

Instantly share code, notes, and snippets.

@luisbebop
luisbebop / life_hello_world.rb
Created April 11, 2015 19:59
A early prototype describing how "program life" should be
require "openlife"
def add_pGLO(bacteria)
construct = GeneticCircuit.new(:assembly)
construct.add_selection_gene(:AmpR)
construct.add_promoter(:very_strong)
construct.add_rbs(:very_strong)
construct.add_gene(:GFP)
construct.add_terminator(:ter)
construct.replication_origin(:high)
@luisbebop
luisbebop / wsparser.rb
Created November 13, 2009 18:26
Use this script to parse Walk Server 2 log files
# http://rubular.com/regexes/11722
# sudo gem install dm-core
# sudo gem install dm-validations
# sudo gem install do_sqlite3
# parse walk server (www.planobe.com.br) log files and write to a database called walk_server.sqlite3 on current directory/db
# Using:
# ruby wsparser.rb walk_server2/LOGS/
require 'rubygems'
THIS DOCUMENT MOVED TO http://chneukirchen.github.com/rps/
AND http://github.com/chneukirchen/rps
= Ruby Packaging Standard
The aim of this document is two-fold. First, to specify a common
structure of how a Ruby package distributed as source (that is, but
not limited to, development directories, version-controlled
repositories, .tar.gz, Gems, ...) should conform to.
# Use this commands inside app folder
git init
git status
git add .
git commit -a
touch tmp/.gitignore log/.gitignore vendor/.gitignore
# Create this .gitignore file
.DS_Store
log/*.log
require 'win32ole'
# based on this tutorial http://www.autoitscript.com/autoit3/docs/tutorials/notepad/notepad.htm
# 1. Download http://www.zapt.in/9Qt
# 2. Put the AutoItX3.dll on c:\windows\system32
# 3. Open the DOS Prompt and register the dll with: "regsvr32 C:\windows\system32\AutoItX3.dll
# 4. Install Ruby if you don't have it already installed: http://www.rubyinstaller.org/
# 5. Execute this file
@au3 = WIN32OLE.new "AutoItX3.Control"

Cut the middlemen

Minimal example how to use CouchDB JSON exports without any server-side middleware (Ruby, Python, PHP, etc) and showcase its features.

For real „standalone applications“, called CouchApps, see the CouchDB book.

Installation

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
# 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
@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);
@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;