Skip to content

Instantly share code, notes, and snippets.

@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 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 / 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 / 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 / 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-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-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-0.lisp
Created April 7, 2012 03:05
hello world 0
; display the message
(display "hello world\n")
@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)