Skip to content

Instantly share code, notes, and snippets.

View vguerra's full-sized avatar
💭
🏂

Victor Guerra vguerra

💭
🏂
View GitHub Profile
@vguerra
vguerra / gist:83e38ed0a9275af08d7c
Created May 3, 2014 01:28
using pkg-config to query information about nanomsg
diff --git a/wscript b/wscript
index fe8cfb7..3b403a1 100755
--- a/wscript
+++ b/wscript
@@ -43,7 +43,7 @@ DEFAULT_CONF = {
def build_nanomsgext(waf):
conf = copy(DEFAULT_CONF)
conf.update({
- 'lib' : ['nanomsg'],
+ 'use' : ['NANOMSG'],
@vguerra
vguerra / gist:c94c77b4f155d73d8f47
Last active August 29, 2015 14:00
xotcl-core ::xo::dc database context

Xotcl Core Database Context Objects

Recently, there has been a new addition in xotcl-core that allows to have different database contexts to interact with the database. At run time, one can dynamically change the interface one wants to talk to the DB with. This allows us to operate simultaneously with two db interfaces talking to the same database: nsdb (nsdbpg ) and nsdbi (nsdbipg). The reasons we want to have such a setup are the following:

  • First of all, giving the way nsdbpgi is implemented, queries run sometimes up to 10 times faster through that interface. Therefore we want to be able to use this interface to run our queries. The following tests show how fast it is:
# dbi_* calls beling to the nsdbi interface and db_* calls to the nsdb one.
append _ [time {dbi_rows  {select object_id from acs_objects limit 200}} 100]
append _ [time {dbi_rows {select object_id, title from acs_objects limit 200}} 100]
@vguerra
vguerra / gist:10426226
Created April 10, 2014 21:43
multicolumn summary - SquareSpace
<script type='text/javascript'>
YUI().use('node', 'event-base', function (Y) {
Y.on('domready', function () {
Y.all('.summary-block').each(
function () {
// 4 -> 3 cols
// 3 -> 4 cols
// 6 -> 2 cols
Y.all('.summary-item', this).wrap('<div class="col sqs-col-4 span-4"></div>');
Y.all('.col > .summary-item').wrap('<div class="newSummary"></div>');
@vguerra
vguerra / gist:7103126
Created October 22, 2013 15:50
check if untracked file was previously deleted from repository
git ls-files -o | xargs git log -n 1 --diff-filter=D --format=format:%H --
@vguerra
vguerra / gist:5188572
Created March 18, 2013 16:33
Changing binary's rpath. nsd in this case.
chrpath -r ':/data/bin-exp/ns/lib::/data/bin-exp/tcl/lib' nsd
@vguerra
vguerra / gist:3737349
Created September 17, 2012 13:47
nstrace.tcl ( nsf compatibility )
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
@vguerra
vguerra / gist:3486875
Created August 27, 2012 09:22
Starting NaviServer on watchdog mode
#!/bin/sh
/bin/sleep 1
export LANG=en_US.UTF8
umask 002
# NaviServer
#export LD_LIBRARY_PATH=/usr/local/ssl/lib64
#export PATH=$PATH:/usr/local/pg/bin
@vguerra
vguerra / gist:2909190
Created June 11, 2012 09:05
Cloning openacs core and xo-friend packages (all git).
#!/bin/bash
# This script fetches automatically all needed packages
# to have an xowf application up and running.
# It dependes on the git-subtree utility ( which one can find
@vguerra
vguerra / gist:2774209
Created May 23, 2012 09:27
Collecting stats
#!/bin/sh
i=0
while [ $i -lt 1 ]
do
sleep 5
wget -q -O - tlftest.wu.ac.at:8000/stats
echo ""
done
@vguerra
vguerra / gist:2709857
Created May 16, 2012 12:06
building nsf breaks when dtrace is not installed ( even when --with-dtrace was not used when configuring ).
diff --git a/Makefile.in b/Makefile.in
index c587962..0774957 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -78,8 +78,8 @@ mkinstalldirs= mkdir -p
#========================================================================
DTRACE_OBJ = @DTRACE_OBJ@
-DTRACE_HDR = $(src_generic_dir)/nsfDTrace.h
-DTRACE_SRC = $(src_generic_dir)/nsfDTrace.d