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
Lisp interpreter in 90 lines of C++ | |
I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second. | |
Just for fun I wondered if I could write one in C++. My goals would be | |
1. A Lisp interpreter that would complete Peter's Lis.py test cases correctly... | |
2. ...in no more than 90 lines of C++. | |
Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake! |
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
<?php | |
// PHP Hello World! | |
echo phpinfo(); | |
?> |
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
#!/usr/bin/env python | |
#--*-- coding: UTF-8 --*-- | |
import sys | |
def generateNewParts(parts, isHeader = True): | |
if len(parts) == 3: | |
return parts | |
pos = parts[1].find('(') |
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
#!/usr/bin/env python | |
#--*-- coding: UTF-8 --*-- | |
import urllib | |
import re | |
import sys | |
sae_cdn_libs = ['angular.js', 'backbone', 'bootstrap', 'dojo', 'ext-core', 'highcharts', | |
'highstock', 'jq.mobi', 'jquery', 'jquery-mobile', 'jquery-ui', 'jquery.cookie', | |
'jquery.migrate', 'jquerytools', 'json2', 'lesscss', 'mootools', 'prototype', 'qunit', |
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
/* | |
* test1.cpp | |
* This program shows how to access Cocoa GUI from pure C/C++ | |
* and build a truly functional GUI application (although very simple). | |
* | |
* Compile using: | |
* g++ -framework Cocoa -o test1 test1.cpp | |
* | |
* that will output 'test1' binary. | |
*/ |
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
Pod::Spec.new do |s| | |
s.name = "Sparkle" | |
s.version = "0.1.0" | |
s.summary = "A software update framework for the Mac" | |
s.description = <<-DESC | |
Sparkle is an easy-to-use software update framework for Cocoa developers. | |
* True self-updating--no work required from the user. | |
* Displays release notes to the user via WebKit. | |
* Displays a detailed progress window to the user. |
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 | |
F=fixtures.md | |
for rar in `ls *.rar` | |
do | |
echo "it('test $rar', function() {" | |
echo "var entries = rar.list('./test/fixtures/${rar}'); " | |
echo "var expected = [" | |
unrar lb $rar | sed -e 's/^/ "/' | sed -e 's/$/", /' |
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 | |
F=fixtures.md | |
for rar in `ls *.rar` | |
do | |
echo "it('test extract $rar', function() {" | |
echo "rar.extract('./test/fixtures/${rar}', './tmp/'); " | |
echo "var expected = [" | |
unrar lb $rar | sed -e 's/^/ "/' | sed -e 's/$/", /' |
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
function fab(n) { | |
if (n < 3) { | |
return 1; | |
} | |
var p1=1, p2=1, p; | |
function _fab(m) { | |
if (m < n) { | |
p = p1 + p2; | |
p1 = p2; | |
p2 = p; |
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
var fs = require('fs'); | |
var files = ['a.txt', 'b.txt', 'c.txt']; | |
for (var i = 0; i < files.length; i++) { | |
fs.readFile(files[i], 'utf-8', function(err, contents) { | |
console.log(files[i] + ': ' + contents); | |
}); | |
} |
OlderNewer