Skip to content

Instantly share code, notes, and snippets.

View gabrielmancini's full-sized avatar

Gabriel Mancini de Campos gabrielmancini

View GitHub Profile
@gabrielmancini
gabrielmancini / rake.log
Created March 17, 2012 22:20
error on rake iriscouch/build-couchdb on debian
This file has been truncated, but you can view the full file.
STDOUT Build CouchDB commit: 7f11becad433f2a3e710c29052cb06e5a6ba2fef
STDOUT /root/build-couchdb/build/bin/autoconf2.62 => /root/build-couchdb/build/bin/autoconf
STDOUT /root/build-couchdb/build/bin/autoreconf2.62 => /root/build-couchdb/build/bin/autoreconf
STDOUT /root/build-couchdb/build/bin/autoheader2.62 => /root/build-couchdb/build/bin/autoheader
STDOUT /root/build-couchdb/build/bin/autom4te2.62 => /root/build-couchdb/build/bin/autom4te
STDERR ./buildconf
STDOUT buildconf: autoconf version 2.62 (ok)
STDOUT buildconf: autom4te version 2.62 (ok)
STDOUT buildconf: autoheader version 2.62 (ok)
STDOUT buildconf: automake version 1.11.2 (ok)
@gabrielmancini
gabrielmancini / interpolate String in JS
Created December 13, 2012 16:54
to avoid contatenação strings (the idea is just to avoid the possibility of errors). follows an extension of the String Object
String.prototype.supplant = function (o) {
return this.replace(/{([^{}]*)}/g,
function (a, b) {
var r = o[b];
return typeof r === 'string' || typeof r === 'number' ? r : a;
}
);
};
// Ho to use:
@gabrielmancini
gabrielmancini / ngListModules.js
Last active December 28, 2015 16:59
ngListModules
function list(module, modules) {
var modules;
if (module) {
modules = angular.module(module).requires
console.log(module, '->', modules);
while(module && modules.length) {
@gabrielmancini
gabrielmancini / ulimit.sh
Created April 8, 2014 14:32
Ulimit problem on linux
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
/**
* Hoodie plugin template
* An example plugin worker, this is where you put your backend code (if any)
*/
var OAuth = require('oauthio'),
session = require('express-session'),
async = require('async'),
_ = require('lodash'),
debug = require('debug'),
log = debug('app:log'),
var async = require('async'),
passwd = require('hoodie-plugin-users/lib/password_reset'),
debug = require('debug'),
log = debug('app:log'),
log2 = debug('app:log2'),
error = debug('app:error'),
util = require('util'),
moment = require('moment');
error.log = console.error.bind(console);
10:29:25 (hoodie) ~/Documents/github/goappes/experimento$ DEBUG=app.log2 gulp serve
[22:29:28] Using gulpfile ~/Documents/github/goappes/experimento/gulpfile.js
[22:29:28] Starting 'bower'...
[22:29:28] Starting 'bower:install'...
[22:29:28] Starting 'dist:config:development'...
[22:29:28] Finished 'dist:config:development' after 7.43 ms
[22:29:28] Starting 'dist:config'...
[22:29:28] Finished 'dist:config' after 11 μs
[22:29:28] Finished 'bower:install' after 775 ms
[22:29:28] Starting 'bower:assets:clean'...
@gabrielmancini
gabrielmancini / gist:b40fba563919f88c322c
Created January 29, 2015 20:16
link projects goappes
cd hoodie-plugin-chat && npm link && cd .. &&
cd hoodie-plugin-cordovafb && npm link && cd .. &&
cd hoodie-plugin-image && npm link && cd .. &&
cd hoodie-plugin-notification && npm link && cd .. &&
cd hoodie-plugin-oauthio && npm link && cd .. &&
cd hoodie-plugin-paranoia && npm link && cd .. &&
cd hoodie-plugin-profile && npm link && cd .. &&
cd hoodie-plugin-pubsub && npm link && cd .. &&
cd hoodie-plugin-socialmedia && npm link && cd .. &&
cd hoodie-utils-plugins && npm link && cd ..
defmodule Lib do
def filter(list) do
Enum.filter(list, fn x -> rem(x, 3) == 0 || rem(x, 5) == 0 end)
end
def reduce(list) do
Enum.reduce(list, 0, fn (acc, x) -> acc + x end)
end
def filter_error(_list) do
:error_n
end