Skip to content

Instantly share code, notes, and snippets.

@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
@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 | \
  1. This should stike through
-- 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
@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
@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();
task :add_other_combined do
if MANIFEST.target[:target_name] =~ /\/myapp/i
tmp_entries = []
tmp_entries.push MANIFEST.entry_for('someframework:javascript.js')
tmp_entries.push MANIFEST.entry_for('anotherframework:javascript.js')
tmp_entries.each { |e|
e.clean!
}
MANIFEST.add_composite 'all_the_stuffs.js',
:source_entries => tmp_entries,
/*globals global*/
global.DEBUG = false;
var smartdown = require("smartdown"), fs = require("core_support:fs"),
spawn = require("spawn"), sys = require("sys"),
Path = require("core_support:path");
var fixPath = function(opts) {
if (global.DEBUG) sys.puts("Entered fixPath:");
var outputDirectory = opts.output;
if (outputDirectory[outputDirectory.length - 1] !== "/") outputDirectory += "/";
objectA = SC.Object.create({
calledLocalObserver: false,
calledGlobalObserver: false,
calledMixedObserver: false,
locallyObservedProperty: 'beingWatched',
testLocalObserver: function() {
this.calledLocalObserver = true;
}.observes('locallyObservedProperty'),
task 'build', 'build all of the source files', ->
sourceFiles: ['test.coffee']
fs: require('fs'); sys: require('sys');
seed: require('seed'); coffee: seed.require('coffee-script');
for src in sourceFiles
fs.readFile src, (err, code) ->
compiled: coffee.compile code
fs.writeFile src.replace(/\.coffee/,'.js'), compiled, "utf8", (err) ->
throw err if err
puts "Compiled $src -> ${src.replace(/\.coffee/,'.js')}."