diff options
| author | Ben Beltran <ben@freshout.us> | 2013-03-25 16:36:57 -0600 |
|---|---|---|
| committer | Ben Beltran <ben@freshout.us> | 2013-03-25 16:36:57 -0600 |
| commit | f0c1d1ca24eaefc12e2e1092bd9dbc954b7f4d3c (patch) | |
| tree | 789f17466b3766a1ada8abc5e49967377bb07766 /vim/.backup | |
| parent | 30a7092fe25d693f33637a92d2abb5ba1c4aea58 (diff) | |
Update the stuff
Diffstat (limited to 'vim/.backup')
26 files changed, 598 insertions, 0 deletions
diff --git a/vim/.backup/.htaccess.swp b/vim/.backup/.htaccess.swp Binary files differnew file mode 100644 index 0000000..5c0572a --- /dev/null +++ b/vim/.backup/.htaccess.swp diff --git a/vim/.backup/App-Movement-RCA-Spec.md.swp b/vim/.backup/App-Movement-RCA-Spec.md.swp Binary files differnew file mode 100644 index 0000000..230e570 --- /dev/null +++ b/vim/.backup/App-Movement-RCA-Spec.md.swp diff --git a/vim/.backup/Community.js.swp b/vim/.backup/Community.js.swp Binary files differnew file mode 100644 index 0000000..9d2431d --- /dev/null +++ b/vim/.backup/Community.js.swp diff --git a/vim/.backup/Entries-CRUD-RCA-Spec.md.swp b/vim/.backup/Entries-CRUD-RCA-Spec.md.swp Binary files differnew file mode 100644 index 0000000..d8cc0a3 --- /dev/null +++ b/vim/.backup/Entries-CRUD-RCA-Spec.md.swp diff --git a/vim/.backup/EventTracker.js.swp b/vim/.backup/EventTracker.js.swp Binary files differnew file mode 100644 index 0000000..efd9596 --- /dev/null +++ b/vim/.backup/EventTracker.js.swp diff --git a/vim/.backup/LargeFile.vim~ b/vim/.backup/LargeFile.vim~ new file mode 100644 index 0000000..9f6551e --- /dev/null +++ b/vim/.backup/LargeFile.vim~ @@ -0,0 +1,80 @@ +" LargeFile: Sets up an autocmd to make editing large files work with celerity +" Author: Charles E. Campbell, Jr. +" Date: Sep 23, 2008 +" Version: 4 +" GetLatestVimScripts: 1506 1 :AutoInstall: LargeFile.vim + +" --------------------------------------------------------------------- +" Load Once: {{{1 +if exists("g:loaded_LargeFile") || &cp + finish +endif +let g:loaded_LargeFile = "v4" +let s:keepcpo = &cpo +set cpo&vim + +" --------------------------------------------------------------------- +" Commands: {{{1 +com! Unlarge call s:Unlarge() +com! -bang Large call s:LargeFile(<bang>0,expand("%")) + +" --------------------------------------------------------------------- +" Options: {{{1 +if !exists("g:LargeFile") + let g:LargeFile= 20 " in megabytes +endif + +" --------------------------------------------------------------------- +" LargeFile Autocmd: {{{1 +" for large files: turns undo, syntax highlighting, undo off etc +" (based on vimtip#611) +augroup LargeFile + au! + au BufReadPre * call <SID>LargeFile(0,expand("<afile>")) + au BufReadPost * + \ if &ch < 2 && (getfsize(expand("<afile>")) >= g:LargeFile*1024*1024 || getfsize(expand("<afile>")) == -2) + \| echomsg "***note*** handling a large file" + \| endif +augroup END + +" --------------------------------------------------------------------- +" s:LargeFile: {{{2 +fun! s:LargeFile(force,fname) +" call Dfunc("LargeFile(force=".a:force." fname<".a:fname.">)") + if a:force || getfsize(a:fname) >= g:LargeFile*1024*1024 || getfsize(a:fname) <= -2 + syn clear + let b:eikeep = &ei + let b:ulkeep = &ul + let b:bhkeep = &bh + let b:fdmkeep= &fdm + let b:swfkeep= &swf + set ei=FileType + setlocal noswf bh=unload fdm=manual ul=-1 + let fname=escape(substitute(a:fname,'\','/','g'),' ') + exe "au LargeFile BufEnter ".fname." set ul=-1" + exe "au LargeFile BufLeave ".fname." let &ul=".b:ulkeep."|set ei=".b:eikeep + exe "au LargeFile BufUnload ".fname." au! LargeFile * ". fname + echomsg "***note*** handling a large file" + endif +" call Dret("s:LargeFile") +endfun + +" --------------------------------------------------------------------- +" s:Unlarge: this function will undo what the LargeFile autocmd does {{{2 +fun! s:Unlarge() +" call Dfunc("s:Unlarge()") + if exists("b:eikeep") |let &ei = b:eikeep |endif + if exists("b:ulkeep") |let &ul = b:ulkeep |endif + if exists("b:bhkeep") |let &bh = b:bhkeep |endif + if exists("b:fdmkeep")|let &fdm = b:fdmkeep|endif + if exists("b:swfkeep")|let &swf = b:swfkeep|endif + syn on + doau FileType +" call Dret("s:Unlarge") +endfun + +" --------------------------------------------------------------------- +" Restore: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo +" vim: ts=4 fdm=marker diff --git a/vim/.backup/Rule.js.swp b/vim/.backup/Rule.js.swp Binary files differnew file mode 100644 index 0000000..3d23813 --- /dev/null +++ b/vim/.backup/Rule.js.swp diff --git a/vim/.backup/Vimball.swo b/vim/.backup/Vimball.swo Binary files differnew file mode 100644 index 0000000..845507d --- /dev/null +++ b/vim/.backup/Vimball.swo diff --git a/vim/.backup/Vimball.swp b/vim/.backup/Vimball.swp Binary files differnew file mode 100644 index 0000000..99764ea --- /dev/null +++ b/vim/.backup/Vimball.swp diff --git a/vim/.backup/[Rhenium]-Rhenium-Spec.md.swp b/vim/.backup/[Rhenium]-Rhenium-Spec.md.swp Binary files differnew file mode 100644 index 0000000..990306d --- /dev/null +++ b/vim/.backup/[Rhenium]-Rhenium-Spec.md.swp diff --git a/vim/.backup/clean_db.rb.swp b/vim/.backup/clean_db.rb.swp Binary files differnew file mode 100644 index 0000000..9d6f1c8 --- /dev/null +++ b/vim/.backup/clean_db.rb.swp diff --git a/vim/.backup/layout.erb.swp b/vim/.backup/layout.erb.swp Binary files differnew file mode 100644 index 0000000..ba28785 --- /dev/null +++ b/vim/.backup/layout.erb.swp diff --git a/vim/.backup/main.js.swp b/vim/.backup/main.js.swp Binary files differnew file mode 100644 index 0000000..d543eff --- /dev/null +++ b/vim/.backup/main.js.swp diff --git a/vim/.backup/page.rb.swp b/vim/.backup/page.rb.swp Binary files differnew file mode 100644 index 0000000..c016f4e --- /dev/null +++ b/vim/.backup/page.rb.swp diff --git a/vim/.backup/player.lua.swp b/vim/.backup/player.lua.swp Binary files differnew file mode 100644 index 0000000..a3a785a --- /dev/null +++ b/vim/.backup/player.lua.swp diff --git a/vim/.backup/schedule.rb.swp b/vim/.backup/schedule.rb.swp Binary files differnew file mode 100644 index 0000000..44d1165 --- /dev/null +++ b/vim/.backup/schedule.rb.swp diff --git a/vim/.backup/server.js~ b/vim/.backup/server.js~ new file mode 100755 index 0000000..dc39a5e --- /dev/null +++ b/vim/.backup/server.js~ @@ -0,0 +1,258 @@ +#!/usr/bin/env node + +require('colors'); +var Ne = require('neon'); + +Nitrogen = { + Manifest : require('./lib/manifest.js'), + Server : {} +}; + +Ne.Class(Nitrogen.Server, 'Editor')({ + prototype : { + fs : require('fs'), + express : require('express'), + httpProxy : require('http-proxy'), + io : require('socket.io'), + http : require('http'), + app : null, + server : null, + socket : null, + port : 4000, + occipitalOptions : {}, + + init : function init(config) { + Object.keys(config).forEach(function (property) { + this[property] = config[property]; + }, this); + + console.log('Nitrogen Session Server starting '); + this.app = this.express(); + this.proxy = new this.httpProxy.RoutingProxy(); + this.server = this.http.createServer(this.app); + this.initRack(); + this.initDb(); + this.initRoutes(); + this.server.listen(this.port); + this.socket = this.io.listen(this.server); + this.initSyncEvents(); + console.log('Nitrogen Session Server listening on port ' + this.port); + }, + + initRack : function initRack() { + var nitrogen = this; + this.app.use(this.express.logger()); + this.app.use(this.express.compress()); + this.app.use(function (request, response, next) { + response.header("Access-Control-Allow-Origin", "*"); + response.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'); + response.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With'); + if ('OPTIONS' == request.method) { + response.send(200); + } + else { + next(); + } + }); + // This has to be here in order for a proxied post to work. + // See https://github.com/nodejitsu/node-http-proxy/issues/180 + // for more information. + this.app.use(function (request, response, next) { + if (request.url.match(/\/attachments\/.*/) && request.method === "POST" ){ + var options = nitrogen.occipitalOptions; + nitrogen.proxy.proxyRequest( request, response, options ); + } else { + return next(); + } + }); + this.app.use(this.express.bodyParser()); + this.app.use('/', this.express.static('public')); + }, + + initDb : function initDb() { + var fileNames = this.fs.readdirSync(__dirname + '/../').filter(function(fn){ return fn.match(/.*\.json$/); }); + var i, filePath, collectionName; + data = Nitrogen.data = {}; + + for( i=0; i < fileNames.length; i+=1 ){ + filePath = __dirname + '/../' + fileNames[i]; + collectionName = fileNames[i].replace(/.json/, ''); + data[collectionName] = this.fs.readFileSync(filePath).toString().replace(/\n$/, "").split(/\n/).map(function(r){ + return JSON.parse(r); + }); + } + }, + + initRoutes : function initRoutes() { + var nitrogen = this, + path = require('path'); + + this.app.get('/', function (request, response) { + var file = path.resolve('./public/app.html'); + response.sendfile(file); + }); + + this.app.get('/api/all', function (req, res) { + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(data)); + }); + + this.app.get('/api/:model', function (req, res) { + var records = data[req.params.model] + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(records)); + }); + + this.app.get('/api/:model/:id', function (req, res){ + var model = req.params.model; + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + + if (record) { + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(record)); + } + else { + res.set('Content-Type', 'application/json'); + res.send(404, 'record not found'); + } + }); + + this.app.get('/api/:model/:id/delete', function (req, res){ + var model = req.params.model; + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + + data[model].splice(data[model].indexOf(record), 1); + + res.set('Content-Type', 'application/json'); + res.send('{}'); + }); + + this.app.post('/api/:model/create', function (req, res){ + var model = req.params.model; + var record = req.body; + record.id = util.generateUid(24); + + data[model].push(record); + + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(record)); + }); + + this.app.post('/api/:model/:id/update', function (req, res){ + var model = req.params.model; + + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + + var position = data[model].indexOf(record); + console.log(req); + data[model].splice(position, 1, req.body); + + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(record)); + }); + + this.app.get('/manifest_doc.js', function (req, res) { + res.set('Content-Type', 'application/json'); + + // Generate the package every time for development + Manifest.generatePackage(function () { + res.sendfile(path.resolve('./public/manifest_doc.js')); + }); + /* TODO: Uncomment when file detection is done + nitrogen.fs.exists('./public/manifest_doc.js', function (exists) { + if (exists) { + res.sendfile(path.resolve('./public/manifest_doc.js')); + } else { + // create package + Manifest.generatePackage(function () { + res.sendfile(path.resolve('./public/manifest_doc.js')); + }); + } + }); */ + }); + + this.app.get('/get_assets', function (req, res) { + res.set('Content-Type', 'text/plain'); + + // Generate the package everytime for development + Manifest.generatePackage(function () { + res.sendfile(path.resolve('../app_assets/package.dat')); + }); + /* TODO: Uncomment when file detection is ready + nitrogen.fs.exists('../app_assets/package.dat', function (exists) { + if (exists) { + res.sendfile(path.resolve('../app_assets/package.dat')); + } else { + // create package + Manifest.generatePackage(function () { + res.sendfile(path.resolve('../app_assets/package.dat')); + }); + } + }); */ + }); + + this.app.get('/attachments/*', function (req, res) { + var options = nitrogen.occipitalOptions; + + nitrogen.proxy.proxyRequest( req, res, options ); + }); + }, + + initSyncEvents : function () { + this.socket.sockets.on('connection', function (socket) { + socket.emit('connected', {message : "Connection established"}); + + socket.on('sync', function (sync_data) { + console.log(">> Incoming LSD DATA".blue); + + sync_data = JSON.parse(sync_data); + + // Let's handle each guy + switch(sync_data.action) { + case "create": + data["tasks"].push(sync_data.data); + break; + case "update": + var record = data["tasks"].filter(function (record) { + return record.id == sync_data.data.id; + })[0]; + var position = data["tasks"].indexOf(record); + data["tasks"].splice(position, 1, sync_data.data); + break; + case "remove": + var record = data["tasks"].filter(function (record) { + return record.id == sync_data.data.id; + })[0]; + var position = data["tasks"].indexOf(record); + data["tasks"].splice(position, 1); + break; + } + + socket.emit('sync_ok', {message : "Sync Received: OK"}); + }); + }); + + this.socket.sockets.on('disconnect', function (socket) { + socket.emit('disconnected', {message : "Connection lost"}); + }); + } + } +}); + +new Nitrogen.Server.Editor({ + port : process.argv[2] || 4000, + occipitalOptions : { + host : (process.argv[3]) ? process.argv[3].replace(/:.*/, '') : '127.0.0.1', + port : (process.argv[3]) ? process.argv[3].replace(/.*:/, '') : '3001' + } +}); + diff --git a/vim/.backup/server.jz~ b/vim/.backup/server.jz~ new file mode 100755 index 0000000..907e448 --- /dev/null +++ b/vim/.backup/server.jz~ @@ -0,0 +1,260 @@ +#!/usr/bin/env node + +require('colors'); +var Ne = require('neon'); + +Nitrogen = { + Manifest : require('./lib/manifest.js'), + Server : {} +}; + +Ne.Class(Nitrogen.Server, 'Editor')({ + prototype : { + fs : require('fs'), + express : require('express'), + httpProxy : require('http-proxy'), + io : require('socket.io'), + http : require('http'), + app : null, + server : null, + socket : null, + port : 4000, + occipitalOptions : {}, + + init : function init(config) { + Object.keys(config).forEach(function (property) { + this[property] = config[property]; + }, this); + + console.log('Nitrogen Session Server starting '); + this.app = this.express(); + this.proxy = new this.httpProxy.RoutingProxy(); + this.server = this.http.createServer(this.app); + this.initRack(); + this.initDb(); + this.initRoutes(); + this.server.listen(this.port); + this.socket = this.io.listen(this.server); + this.socket.set('transports', ['websocket']) + this.socket.disable('heartbeats'); + this.initSyncEvents(); + console.log('Nitrogen Session Server listening on port ' + this.port); + }, + + initRack : function initRack() { + var nitrogen = this; + this.app.use(this.express.logger()); + this.app.use(this.express.compress()); + this.app.use(function (request, response, next) { + response.header("Access-Control-Allow-Origin", "*"); + response.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'); + response.header('Access-Control-Allow-Headers', 'Content-Type, Authorization, Content-Length, X-Requested-With'); + if ('OPTIONS' == request.method) { + response.send(200); + } + else { + next(); + } + }); + // This has to be here in order for a proxied post to work. + // See https://github.com/nodejitsu/node-http-proxy/issues/180 + // for more information. + this.app.use(function (request, response, next) { + if (request.url.match(/\/attachments\/.*/) && request.method === "POST" ){ + var options = nitrogen.occipitalOptions; + nitrogen.proxy.proxyRequest( request, response, options ); + } else { + return next(); + } + }); + this.app.use(this.express.bodyParser()); + this.app.use('/', this.express.static('public')); + }, + + initDb : function initDb() { + var fileNames = this.fs.readdirSync(__dirname + '/../').filter(function(fn){ return fn.match(/.*\.json$/); }); + var i, filePath, collectionName; + data = Nitrogen.data = {}; + + for( i=0; i < fileNames.length; i+=1 ){ + filePath = __dirname + '/../' + fileNames[i]; + collectionName = fileNames[i].replace(/.json/, ''); + data[collectionName] = this.fs.readFileSync(filePath).toString().replace(/\n$/, "").split(/\n/).map(function(r){ + return JSON.parse(r); + }); + } + }, + + initRoutes : function initRoutes() { + var nitrogen = this, + path = require('path'); + + this.app.get('/', function (request, response) { + var file = path.resolve('./public/app.html'); + response.sendfile(file); + }); + + this.app.get('/api/all', function (req, res) { + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(data)); + }); + + this.app.get('/api/:model', function (req, res) { + var records = data[req.params.model] + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(records)); + }); + + this.app.get('/api/:model/:id', function (req, res){ + var model = req.params.model; + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + + if (record) { + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(record)); + } + else { + res.set('Content-Type', 'application/json'); + res.send(404, 'record not found'); + } + }); + + this.app.get('/api/:model/:id/delete', function (req, res){ + var model = req.params.model; + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + + data[model].splice(data[model].indexOf(record), 1); + + res.set('Content-Type', 'application/json'); + res.send('{}'); + }); + + this.app.post('/api/:model/create', function (req, res){ + var model = req.params.model; + var record = req.body; + record.id = util.generateUid(24); + + data[model].push(record); + + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(record)); + }); + + this.app.post('/api/:model/:id/update', function (req, res){ + var model = req.params.model; + + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + + var position = data[model].indexOf(record); + console.log(req); + data[model].splice(position, 1, req.body); + + var record = data[model].filter(function (record) { + return record.id == req.params.id; + })[0]; + res.set('Content-Type', 'application/json'); + res.send(JSON.stringify(record)); + }); + + this.app.get('/manifest_doc.js', function (req, res) { + res.set('Content-Type', 'application/json'); + + // Generate the package every time for development + Manifest.generatePackage(function () { + res.sendfile(path.resolve('./public/manifest_doc.js')); + }); + /* TODO: Uncomment when file detection is done + nitrogen.fs.exists('./public/manifest_doc.js', function (exists) { + if (exists) { + res.sendfile(path.resolve('./public/manifest_doc.js')); + } else { + // create package + Manifest.generatePackage(function () { + res.sendfile(path.resolve('./public/manifest_doc.js')); + }); + } + }); */ + }); + + this.app.get('/get_assets', function (req, res) { + res.set('Content-Type', 'text/plain'); + + // Generate the package everytime for development + Manifest.generatePackage(function () { + res.sendfile(path.resolve('../app_assets/package.dat')); + }); + /* TODO: Uncomment when file detection is ready + nitrogen.fs.exists('../app_assets/package.dat', function (exists) { + if (exists) { + res.sendfile(path.resolve('../app_assets/package.dat')); + } else { + // create package + Manifest.generatePackage(function () { + res.sendfile(path.resolve('../app_assets/package.dat')); + }); + } + }); */ + }); + + this.app.get('/attachments/*', function (req, res) { + var options = nitrogen.occipitalOptions; + + nitrogen.proxy.proxyRequest( req, res, options ); + }); + }, + + initSyncEvents : function () { + this.socket.sockets.on('connection', function (socket) { + socket.emit('connected', {message : "Connection established"}); + + socket.on('sync', function (sync_data) { + console.log(">> Incoming LSD DATA".blue); + + sync_data = JSON.parse(sync_data); + + // Let's handle each guy + switch(sync_data.action) { + case "create": + data["tasks"].push(sync_data.data); + break; + case "update": + var record = data["tasks"].filter(function (record) { + return record.id == sync_data.data.id; + })[0]; + var position = data["tasks"].indexOf(record); + data["tasks"].splice(position, 1, sync_data.data); + break; + case "remove": + var record = data["tasks"].filter(function (record) { + return record.id == sync_data.data.id; + })[0]; + var position = data["tasks"].indexOf(record); + data["tasks"].splice(position, 1); + break; + } + + socket.emit('sync_ok', {message : "Sync Received: OK"}); + }); + }); + + this.socket.sockets.on('disconnect', function (socket) { + socket.emit('disconnected', {message : "Connection lost"}); + }); + } + } +}); + +new Nitrogen.Server.Editor({ + port : process.argv[2] || 4000, + occipitalOptions : { + host : (process.argv[3]) ? process.argv[3].replace(/:.*/, '') : '127.0.0.1', + port : (process.argv[3]) ? process.argv[3].replace(/.*:/, '') : '3001' + } +}); + diff --git a/vim/.backup/style_propagation.rb.swp b/vim/.backup/style_propagation.rb.swp Binary files differnew file mode 100644 index 0000000..d94f28e --- /dev/null +++ b/vim/.backup/style_propagation.rb.swp diff --git a/vim/.backup/tidy_db.rb.swo b/vim/.backup/tidy_db.rb.swo Binary files differnew file mode 100644 index 0000000..f9f69fa --- /dev/null +++ b/vim/.backup/tidy_db.rb.swo diff --git a/vim/.backup/trashcan.js.swp b/vim/.backup/trashcan.js.swp Binary files differnew file mode 100644 index 0000000..e798ad2 --- /dev/null +++ b/vim/.backup/trashcan.js.swp diff --git a/vim/.backup/voice_feeder.rb.swp b/vim/.backup/voice_feeder.rb.swp Binary files differnew file mode 100644 index 0000000..e3e557d --- /dev/null +++ b/vim/.backup/voice_feeder.rb.swp diff --git a/vim/.backup/widget.js.swn b/vim/.backup/widget.js.swn Binary files differnew file mode 100644 index 0000000..14c88af --- /dev/null +++ b/vim/.backup/widget.js.swn diff --git a/vim/.backup/widget.js.swo b/vim/.backup/widget.js.swo Binary files differnew file mode 100644 index 0000000..c26c46e --- /dev/null +++ b/vim/.backup/widget.js.swo diff --git a/vim/.backup/widget.js.swp b/vim/.backup/widget.js.swp Binary files differnew file mode 100644 index 0000000..21d79bc --- /dev/null +++ b/vim/.backup/widget.js.swp diff --git a/vim/.backup/you_tube.rb.swp b/vim/.backup/you_tube.rb.swp Binary files differnew file mode 100644 index 0000000..88f58b0 --- /dev/null +++ b/vim/.backup/you_tube.rb.swp |