Skip to content

Instantly share code, notes, and snippets.

@marianoguerra
marianoguerra / table2rst.py
Created August 10, 2011 16:14
csv table 2 rst
'''read a csv file representing a table and write a restructured text simple
table'''
import sys
import csv
def get_out(out=None):
'''
return a file like object from different kinds of values
None: returns stdout
string: returns open(path)
@marianoguerra
marianoguerra / hello-0.lisp
Created April 7, 2012 03:05
hello world 0
; display the message
(display "hello world\n")
@marianoguerra
marianoguerra / hello-2.lisp
Created April 7, 2012 03:11
hello world 2
; ask for the name
(display "name? ")
; bind the input to a variable
($let ((name (read-line)))
; build the message and bind it t a variable
($let ((message (string-append "Hello " name "!\n")))
; display the message
(display message)))
@marianoguerra
marianoguerra / hello-3.lisp
Created April 7, 2012 03:13
hello world 3
; define a function to ask for a name
($define! ask-name ($lambda ()
($sequence
(display "name? ")
(read-line))))
; define a function to build the message
($define! build-message ($lambda (name)
(string-append "Hello " name "!\n")))
@marianoguerra
marianoguerra / hello-4.lisp
Created April 7, 2012 03:14
hello world 4
; define a function to ask for a name
($define! ask-name ($lambda ()
($sequence
(display "name? ")
(read-line))))
; define a function to build the message
($define! build-message ($lambda (name)
(string-append "Hello " name "!\n")))
@marianoguerra
marianoguerra / hello-1.lisp
Created April 7, 2012 03:20
hello world 1
; ask for the name
(display "name? ")
; display the message
(display (string-append "Hello " (read-line) "!\n"))
@marianoguerra
marianoguerra / README.rst
Created August 3, 2012 10:08
test requirejs toUrl method on different settups (requirejs version 2.0.4)

require.toUrl test

this repo is setup to store some files to test require.toUrl

to run start a web browser at the root of this repo, for example:

cd 3246403
python -m SimpleHTTPServer
@marianoguerra
marianoguerra / README.rst
Created August 3, 2012 13:07
requirejs example for issue 404

requirejs example for issue 404

this gist contains code to propose a fix for issue 404 on requirejs.

project structure:

├── demo.js
├── index.html
├── libs
@marianoguerra
marianoguerra / pypy-ctypes-bug.rst
Created August 7, 2012 04:55
Pypy ctypes struct initialization and assignment bug

Pypy ctypes struct initialization and assignment bug

to setup the example:

mkdir pypy-ctypes-bug
cd pypy-ctypes-bug
git clone https://github.com/hcatlin/libsass.git
cd libsass
./configure && make
@marianoguerra
marianoguerra / README.rst
Created August 10, 2012 09:04
Jquery 1.8.0 and Jquery UI 1.8.22 dialog buttons bug

this gist is an example to reproduce a bug when using Jquery 1.8.0 and Jquery UI 1.8.22 and trying to set the buttons with an array of objects.

the example works if jquery is 1.7.2 but not with 1.8.0

to test

live test