Clipbook.it Website Architecure 1.0
Submitted by moxley on Thu, 2011-04-28 17:54Client: HTML + CSS + JavaScript + JQuery
Server-Side Web Tier: PHP
Data Tier: Python + MySQL
Client Tier
The client tier is the standard HTML, CSS and JavaScript. JavaScript is supported by JQuery.
Web Tier
The web layer is written in PHP. It roughly follows the principles outlined by Rasmus Leodorf's "No-Framework PHP MVC Framework".
Delete Records Recursively
Submitted by moxley on Mon, 2011-04-18 16:58def delete_records(table, parent_tables=[]):
"Pseudo code to delete all records from a table and its descendants"
parent_tables.append(table)
for child in child_tables(table):
delete_it = True
for fkey in foreign_keys_from(child):
if not (fkey.f_table in parent_tables):
delete_it = False
break
if delete_it:
delete_records(child)
execute_sql("DELETE FROM %s" % table)
PHP, Python, Ruby and JavaScript
Submitted by moxley on Fri, 2011-04-01 18:01Below, I list what I think the advantages are that one language has over the others. It should be noted that very often these advantages only apply within specific contexts.
What PHP has over Python and Ruby:
Introducing SQittle
Submitted by moxley on Mon, 2011-03-14 04:17SQittle is an SQL engine I wrote in JavaScript.
To read more about it, or get the source code, go to the SQittle page at GitHub.
Complex mocking with PHPUnit
Submitted by moxley on Fri, 2008-05-09 22:04PHPUnit provides an API for creating Mock Objects and testing code with them.
Clojure Tutorial For the Non-Lisp Programmer
Submitted by moxley on Thu, 2008-05-01 06:30Clojure is a new programming language that uses the Java Virtual Runtime as its platform. Clojure is a dialect of Lisp. The language home page is at http://clojure.org/.
Simple CRUD Generator
Submitted by moxley on Tue, 2008-03-04 23:18This is a simple application that lets you browse and edit a MySQL database in a CRUD-like manner. It requires PHP 5. Be warned, it doesn't generate code. Instead, it produces a user interface on-the-fly.
The user interface consists of three pages. One page show the tables. The second page shows the records for a given table, and the third page allows you to edit a record.
The application is based on some form generation work I've been developing for Modern Merchant. This opens up the application to some interesting extension points.
Try out Modern Merchant
Submitted by moxley on Tue, 2007-05-15 05:52
Javascript Console For IE
Submitted by moxley on Mon, 2006-12-04 20:25I love Firebug for Firefox, but I really don't like debugging Javascript in IE.
I wrote this little console so that I can kind of see what's going on when scripts in IE don't behave the same way as in Firefox. It's inspired by one of my most favorite web development tools ever, Firebug, which is a Firefox extension.
It has three features:
- Outputs messages from anywhere in your javascript code.
- Provides a console to display the messages and evaluate Javascript expressions.
- Has a history of all the Javascript expressions entered. You can navigate the history with the up and down arrows.
Download it: ie-console.js
Try it!. You don't need IE to try it out. However, the history feature doesn't work in Firefox.
Enter this into the console:
document.body.childNodes
Instructions
- Download and save ie-console.js to your website
- Include the script in your HTML like this:
<script type="text/javascript" src="/js/ie-console.js"></script>
- Press F12 to open the console.
- Or, use
console.log()in your JavaScript code to output debugging messages, just like Firebug. - Press F12 again to close the console.
Lightweight Neural Network Ruby Extension
Submitted by moxley on Sat, 2006-11-18 18:34Download and learn about the lwnueralnet C library here.
