Skip to content

Instantly share code, notes, and snippets.

@nagyv
nagyv / gist:e8673fb9344bf6b7fc58
Last active August 29, 2015 14:01
brew install -v --HEAD goaccess 2>&1 failure
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: f92e7ec4077ebb226a9637b369db0e294a7afa8e
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
@nagyv
nagyv / odoo.ini
Created December 29, 2014 15:44
odoo supervisor ini
[program:odoo]
user=openerp
directory=/home/openerp/odoo
command=odoo.py -c /home/openerp/odoo/openerp_serverrc.prod
environment=PATH="/home/openerp/odoo/venv/bin"
autostart=true
autorestart=true
stopsignal=QUIT
stopwaitsecs=30
startsecs=5
@nagyv
nagyv / file1.js
Created February 11, 2012 14:07
Module definition with Node.JS
(function() {
// Save a reference to the global object.
var root = this;
/* do stuff */
root.public_method = function() {};
}).call(this);
@nagyv
nagyv / app.js
Created February 15, 2012 23:47 — forked from tbranyen/app.js
backbone.js sub routing
/* Pretend app setup stuff is here */
/* Kick off app */
jQuery(function($) {
var Gallery = app.module("gallery");
app.Router = Backbone.Router.extend({
routes: {
"add": "main_add"
@nagyv
nagyv / file1.js
Created March 9, 2012 18:07
Using backbone-valiadtion
var backbone_validation = require('backbone-validation');
backbone_validation(app, '/libs/backbone-validation.js');
// and access the browser side validation with
// <script src="/libs/backbone-validation.js"></script>
@nagyv
nagyv / file1.js
Created March 11, 2012 22:46
Connecting to mongodb using a mongodb:// uri
var Db = require('mongodb').Db;
//...
options.noOpen = true;
myDb = Db.connect(mongouri, options);
// or
options.noOpen = false;
@nagyv
nagyv / file1.js
Created March 17, 2012 16:48
Creating JSON request browser with Tobi
var tobi = require('tobi'),
browser = tobi.createBrowser(8000, "localhost");
json_browser = (function(){
var json_header = {headers:
{
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest"
}
};
@nagyv
nagyv / mongoose-test.js
Created April 4, 2012 13:37
The simplest Mongoose app to run
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var myS = new Schema({
name: {type: String, required: true}
});
var My = mongoose.model('My', myS);
var my = new My({'name': 'bika'});
@nagyv
nagyv / gist:2538496
Created April 29, 2012 07:10
Testing mongoose pre-save with async
var mongoose = require('mongoose'),
async = require('async'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var MyS = new Schema({
feeling: String
});
MyS.pre('save', function(done){
async.parallel([
@nagyv
nagyv / README.md
Last active September 20, 2016 13:28
Git image diff

What it this for?

Have you ever wandered how to follow changes in images using git? This is a solution for the problem.

How to install

  1. Copy git-imgdiff.sh somewhere under your $PATH. Probably $HOME/bin.
  2. Create the $HOME/.gitattributes file with the following content ~/.gitattributes