Skip to content

Instantly share code, notes, and snippets.

View nasser's full-sized avatar
🛰️
save-lisp-and-die

Ramsey Nasser nasser

🛰️
save-lisp-and-die
View GitHub Profile
$ cat main.cpp
#include "environment.hpp"
#include <iostream>
using namespace rubinius;
int main(int argc, char** argv) {
Environment env(argc, argv);
env.setup_cpp_terminate();
$ cat main.cpp
#include "environment.hpp"
#include <iostream>
using namespace rubinius;
int main(int argc, char** argv) {
Environment env(argc, argv);
env.setup_cpp_terminate();
@nasser
nasser / a.rb
Created August 5, 2011 22:44
Rubinius Embed Example
puts __FILE__
def salad
"caesar"
end
foo
puts salad
@nasser
nasser / fontdump.m
Created October 6, 2011 22:04
Dump all available fonts on iOS
for(NSString* fam in [UIFont familyNames]) {
NSLog(@"%@", fam);
for (NSString* fon in [UIFont fontNamesForFamilyName:fam]) {
NSLog(@" %@", fon);
}
}
@nasser
nasser / gist:1684605
Created January 26, 2012 19:36
Puzzling
x = async(1, 2, 3)
puts x
x = async(4, 5, 6)
# ----------------------------------------------
# CRITICAL CODE STUDIES: WEEK 2 LITERACIES
#
# David M. Berry Feb 2012
#
# Based on the webpage: http://stunlaw.blogspot.com/2011/09/iteracy-reading-writing-and-running.html
#
# ITERACY.RB
# Programmed in Zajal - http://zajal.cc/
# Many thanks to Ramsey Nasser
@nasser
nasser / embed.rb
Created February 11, 2012 20:02
String Emedding in Zajal
def random_name
first = ["Billy", "Bob", "Tom", "Dick", "Harry"]
last = ["Smith", "Doe", "Gage", "Driscoll", "Nichols"]
return "#{first.sample} #{last.sample}"
end
n = random_name
draw do
# ------------------------------------------------------
#
# Shakespeare Insult Generator 2.1
#
# The program generates a random Shakespearean insult.
# Based on the original Perl code by Stephen Ramsay
#
# Written by David M. Berry
# 09 February 2012
#
@nasser
nasser / embed.h
Created April 4, 2012 17:31
Generic Ruby Embedding API
/**
* VM supplies rb_ctx and rb_obj definitions here
*/
#include "vm_specific.h"
extern "C" {
/**
* Create a embedded ruby context
*/
$("body").load("/index.html div.eb-slides", function() {
$("img").removeAttr("width");
$("img").removeAttr("height");
$(".views-field-view-node").remove();
});