Skip to content

Instantly share code, notes, and snippets.

@joshholt
joshholt / data_source.js
Created December 15, 2010 05:09
Implementing fine grain callbacks for the SproutCore Datasource CRUD
/*
sproutcore/frameworks/datastore/data_sources/data_source.js
Starting at line #106
*/
/**
Passing an optional params argument to allow callbacks in Record.refresh();
@joshholt
joshholt / build-tasks-for-gh.markdown
Created February 12, 2011 04:17
Documentation about building and deploying tasks to gh-pages

#BuildFile Additions

Add the following line to the top of your Buildfile

config :all, :url_prefix => "/Tasks/static"

#Building and deploying

  1. Create a directory outside of the Tasks root directory named "tasks-builds"
  2. Change into the Tasks root directory and issue sc-build -rc tasks --build=build
-- http://lua-users.org/lists/lua-l/2002-04/msg00180.html
require 'socket'
local header =
[[HTTP/1.1 200 OK
Date: Fri, 19 Apr 2002 20:37:57 GMT
Server: Apache/1.3.23 (Darwin) mod_ssl/2.8.7 OpenSSL/0.9.6b
Cache-Control: max-age=60
Expires: Fri, 19 Apr 2002 20:38:57 GMT
  1. This should stike through
@joshholt
joshholt / Macros.h
Created June 10, 2011 23:58
My Macros That I find useful for Capp Development
#define MAIN_WINDOW [[CPWindow alloc] \
initWithContentRect:CGRectMakeZero() \
styleMask:CPBorderlessBridgeWindowMask]
#define ORDER_FRONT(arg,del) [arg orderFront:del]
#define ALLOC_ORDER_FRONT(klass,del) [[[klass alloc] init] orderFront:del]
#define SUBVIEW(to,from) [to addSubview:from]
#define VIEW_ZERO(klass) [[klass alloc] initWithFrame:CGRectMakeZero()];
#define FULL_MASK(view) [view setAutoresizingMask: CPViewMinXMargin | \
@joshholt
joshholt / Compass Watch
Created November 9, 2011 03:41 — forked from techyak/Compass Watch
the alias that I'm using to watch node.js/coffeescript/compass at the same time
function nodewatch() {
find . | grep coffee$ | xargs coffee -cwl &
if [ $1 ]
then
nodemon $1.js &
else
nodemon app.js &
fi
#logo {background: url(http://dl.dropbox.com/u/5268661/Eloqua.png); height: 55px; width: 125px; display:block;}
.logo { display: none; }
#header,#header-bottom,.dashboard-item-header h3 {background-color: #2d729e !important;}
#header-bottom {border-top: none;}
#header-bottom #main-nav li.aui-dd-parent {background-color: #003f67;}
@joshholt
joshholt / service_document.js
Created January 18, 2012 16:44
Provider Service Document
var BASE_IMG_URL = "http://ccpv2.herokuapp.com/images";
var BASE_COMP_URL = "http://ccpv2.herokuapp.com/components";
module.exports = {
name: 'The CCPV2 Test Provider',
version: '2.0.0',
logoUrl: BASE_IMG_URL + "/cloud_components.png",
components: [{
name: 'My First Component',
description: "This our first cloud component",
@joshholt
joshholt / app_final.js
Created January 18, 2012 20:29
App.js Stages
var express = require('express'),
db = {},
app = express.createServer(),
service_document = require('./lib/service_document'),
middle = require('./lib/route_db_middleware'),
renderer = require('./lib/route_rendering_middleware'),
port = process.env.PORT || 3000;
/*****************************************************************************
* Application Settings
@joshholt
joshholt / route_middle_ware.js
Created January 18, 2012 20:54
Express Route Middleware
var findComponent = function(service_doc, req) {
return service_doc.components.filter(function (c) {
var c_fixed = c.name.toLowerCase().replace(/\s*/g, ''),
req_fixed = req.params.component.toLowerCase();
return c_fixed === req_fixed;
});
};
module.exports = {
configureInstance: function(service_doc) {