This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; line-pragma.scm | |
;; | |
;; This code extends the reader to recognize #l and is meant to | |
;; be used the same way as the #line pragma in C. This way you can | |
;; sprinkle your code with lines like this: | |
;; | |
;; (define (f x) | |
;; #line 314 "increment-literately.w" | |
;; (+ x 1)) | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Original: 1562391 by branan | |
Updated to use GLFW so it works on Mac OS X Lion | |
*/ | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define GLFW_NO_GLU | |
#define GLFW_INCLUDE_GL3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* visualization-library-with-sdl-example.cpp | |
This is an example of using the Visualization Library (VL) [1] | |
without using any of its GUI wrappers. It will render a spinning | |
cube just like the basic scene setup example[2]. However, it does | |
not respond to mouse events. | |
As a suggestion for the future work on VL, I would recommend | |
separating the OpenGLContext class which is required for rendering | |
from what is required for providing a GUI abstraction that will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----------------------------------------------------------------------------- | |
- Project: Remote control Crawling robot | |
- Author: panerqiang@sunfounder.com, modified by Shane Celis @shanecelis | |
- License: GPL v3 | |
- Date: 2015/2/10 | |
* ----------------------------------------------------------------------------- | |
- Overview | |
- This project was written for the Crawling robot desigened by Sunfounder. | |
This version of the robot has 4 legs, and each leg is driven by 3 servos. | |
This robot is driven by a Ardunio Nano Board with an expansion Board. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# shrinkpdf | |
# | |
# Shane Celis | |
if [ $# -ne 1 ] && [ $# -ne 2 ]; then | |
echo "usage: shrinkpdf <in.pdf> [out.pdf]" >&2; | |
echo "Shrink the size of the given PDF. By default it outputs to file 'out.pdf'." >&2; | |
exit 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Possible bug, or at least unexpected behavior, for typed array | |
;; literals. Demonstration below. The same storage is used | |
;; for the same literal. | |
;; | |
;; Run on guile (GNU Guile) 2.0.5 on Mac OS X. | |
;; | |
;; Shane Celis | |
(define x #f64(0. 1. 2.)) | |
(define y #f64(0. 1. 2.)) | |
;; Set the first element of x to 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Problem: Dynamically rendered tweets can cause anchor links to | |
// point at the wrong thing once rendering finishes. (The tweets' | |
// height can change when extra media is pulled in.) | |
// | |
// Fix: Goto the anchor point again after the tweets have loaded if | |
// the link has an anchor tag in it. | |
// | |
// Example: http://seawisphunter.com/vcc/2015/12/14/vermont-coders-connection-tech-show-and-tell-12112015/#shanecelis | |
twttr.events.bind('loaded', | |
function(event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This file demonstrates a bug with C goto labels and Guile. | |
$ gcc `pkg-config guile-2.0 --cflags --libs` goto_label_bug.c -o goto_label_bug | |
goto_label_bug.c: In function 'main': | |
goto_label_bug.c:10: error: expected expression before 'SCM' | |
$ gcc `pkg-config guile-2.0 --cflags --libs` goto_label_bug.c -o goto_label_bug -D INSERT_NOOP | |
$ # No problem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This file exhibits a lots of warnings in a C file that calls GNU | |
Guile. The warnings are shown only when there is a compilation error. | |
Shane Celis | |
*/ | |
#include <libguile.h> | |
#define C_STRING_TO_SYMBOL(str) scm_string_to_symbol(scm_from_locale_string(str)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (make-trampoline module name) | |
"Creates a trampoline out of a symbol in a given module, e.g. (lambda () (name))" | |
(let ((var (module-variable module name))) | |
(unless var | |
(scm-error 'no-such-variable "make-trampoline" "Can't make a trampoline for variable named '~a that does not exist in module ~a." (list name module) #f)) | |
(let ((proc (lambda () ((variable-ref var))))) | |
(set-procedure-property! proc 'name | |
(string->symbol (format #f "~a-trampoline" name))) | |
proc))) |