Skip to content

Instantly share code, notes, and snippets.

View Unitech's full-sized avatar

Alexandre Strzelewicz Unitech

View GitHub Profile
@Unitech
Unitech / installation.sh
Created August 13, 2011 23:06 — forked from mikhailov/installation.sh
Nginx+passenger application config: ssl redirection, http headers, passenger optimal settings. see details: http://mikhailov.posterous.com/nginx
$ cd /usr/src
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz
$ tar xzvf ./nginx-0.8.52.tar.gz
$ rm ./nginx-0.8.52.tar.gz
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc
$ passenger-install-nginx-module
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52
# Where do you want to install Nginx to?: /opt/nginx
@Unitech
Unitech / indent-partial.el
Created October 9, 2011 08:49
Indent in ruby
;;
;; Permits to indent like that :
;; class Comment < ActiveRecord::Base
;; after_create :send_email_to_author,
;; :if => :author_wants_emails?,
;; :unless => Proc.new { |comment| comment.post.ignore_comments? }
;; end
;;
(defadvice ruby-indent-line (after line-up-args activate)
@Unitech
Unitech / object-watch.js
Created July 18, 2012 19:54 — forked from eligrey/object-watch.js
object.watch polyfill
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@Unitech
Unitech / README.md
Created July 20, 2012 11:41 — forked from melanke/README.md
watch the changes of some object or attribute

Watch.js 1.0.13

##compatibility Works with: IE 9+, FF 4+, SF 5+, WebKit, CH 7+, OP 12+, BESEN, Rhino 1.7+ If you want a similar API that works for all browser try MultiGetSet

About

Watch.JS is a small library that brings a lot of possibilities. Maybe you know the design pattern called "Observer", imagine the possibility of executing some function always that some object changes. Well, already exists other libraries that do this, but with Watch.JS you will not have to change your way to develop. Give a chance to Watch.JS, take a look at the examples and how is simple to embody Watch.JS to your routine.

/**
* Blbalalallala
* @author Alexandre Strzelewicz
* @param {sad} argument asd
* @return {asd} sdasd
*/
function blabal (argument) {
// body...
//
@Unitech
Unitech / index.js
Created January 28, 2013 16:54
Init app express
app.configure(function(){
// config
var config = icnf(app.get('env'));
app.db = new mongodb.Db(config.mongodb.db, new mongodb.Server(config.mongodb.host, config.mongodb.port, {auto_reconnect: true}), {safe: true});
// info
app.set('port', config.port || process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.set('config', config);
app.use(cors.header);
@Unitech
Unitech / index.js
Created January 29, 2013 03:10
Node
app.namespace('/user', function(req, res, next) {
console.log(req.session.user);
_.isEmpty(req.session.user) ? res.redirect('/app/denied') : next();
}, require('./apps/User'));
@Unitech
Unitech / User.js
Created January 29, 2013 03:13
test
var msg = {result: true, code: 200, message: '', data: {}};
@Unitech
Unitech / User.js
Created January 29, 2013 03:14
sadsd
var msg = {result: true, code: 200, message: '', data: {}};
@Unitech
Unitech / index.js
Created January 29, 2013 03:17
adsd
// web+api: application
app.namespace('/app', require('./apps/App'));