Skip to content

Instantly share code, notes, and snippets.

/*
* AppController.j
* Created by Bruno Ronchetti on March 21, 2010
* Copyright 2010, Ronchetti & Associati.
* The MIT licence
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
@greut
greut / eventlet_app.py
Created April 23, 2010 10:23
async applications test those with `ab -n 10 -c 10` it should take around 1 sec (and not 10) : http://yoan.dosimple.ch/blog/2010/04/24/
from eventlet import sleep, wsgi, listen
def application(environ, start_response):
start_response("200 OK", [("Content-Type", "text/plain")])
sleep(1)
return ["Hello, world!"]
def main():
wsgi.server(listen(('', 8000)), application)

SC Rendering Architecture

This is a bit wordy, because it actually goes into detail on how the implementation would work, down to how it would approach reordering child views in DOM and the drawbacks of that method.

The summary and examples cover the effects at a higher level.

Goals

Chance 2.0

Chance 2.0 is an evolution of Chance. In addition to CSS syntax extensions and automatic image spriting+data urls, Chance 2.0 also covers some changes to SC build tools and bootstrap, and includes a recommendation on how themes should be structured.

Themes Naming

Currently (1.5), there are multiple parts of a theme name:

import tornado.web
class route(object):
"""
decorates RequestHandlers and builds up a list of routables handlers
Tech Notes (or "What the *@# is really happening here?")
--------------------------------------------------------
Everytime @route('...') is called, we instantiate a new route object which

Proposed View-layer changes

Friday, Juan, Tom, Yehuda and I had a meeting where we discussed the renderer APIs and some ideas we had for the view layer. Here is what we came up with:

Overview

The purpose of these proposed changes is to lower the learning curve for users entering the SproutCore world and who are looking for quick feedback and an easy way to create custom views

@bdarnell
bdarnell / django_tornado_handler.py
Created October 29, 2010 18:59
django_tornado_handler.py
# NOTE: This code was extracted from a larger class and has not been
# tested in this form. Caveat emptor.
import django.conf
import django.contrib.auth
import django.core.handlers.wsgi
import django.db
import django.utils.importlib
import httplib
import json
import logging
@kzk
kzk / evhttp-multh-thread-httpd.cpp
Created November 6, 2010 13:53
Multi-Threaded HTTPServer using evhttp
#include <event.h>
#include <evhttp.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <iostream>
@erichocean
erichocean / gist:741440
Created December 15, 2010 00:58
proof-of-concept: allows you to write <key>Update: functions instead of putting all your code inside update()
// Add this to your custom view or render delegate (see comment below for the rest).
update: function(jquery) {
var fn, key, displayProperties = this.getChangedDisplayProperties() ;
for (key in displayProperties) {
if (!displayProperties.hasOwnProperty(key)) continue ;
if (fn = this[key+'Update']) fn.call(this, jquery, displayProperties[key]) ;
}
}
@buka
buka / fboauthakka.scala
Created December 30, 2010 05:28
Connecting Facebook OAuth with Akka REST...
/**
* Garrick Evans
* 29 Dec 2010
*/
import akka.http._
import akka.actor._
import net.smartam.leeloo.client._
import net.smartam.leeloo.client.request.OAuthClientRequest
import net.smartam.leeloo.client.response. {OAuthAuthzResponse, GitHubTokenResponse}