Skip to content

Instantly share code, notes, and snippets.

View celadevra's full-sized avatar

徐栖 Xuqi celadevra

View GitHub Profile
@celadevra
celadevra / pythonexec.rb.patch
Created May 27, 2012 06:45
Make Octopress's rubypython 0.5.3 work with newer Python in Gentoo 12.0
1c31
< @library = find_python_lib
---
> @library = 'python2'
126c126
< %x(#{@python} -c "#{command}").chomp if @python
---
> %x("#{@python} -c #{command}").chomp if @python
@celadevra
celadevra / 11.4.el
Created November 28, 2011 07:39
Code Examples and Exercises
; Write a function similar to `triangle' in which each row has a value which is the square of the row number. Use a `while' loop.
(defun square-triangle (number-of-rows)
"Calculate the total number of pebbles in a triangle where the number of
pebbles in each row is the square of the number of the row."
(let ((total 0)
(row-number 1))
(while (<= row-number number-of-rows)
(setq total (+ total (* row-number row-number)))
(setq row-number (1+ row-number)))