Skip to content

Instantly share code, notes, and snippets.

View mauroporras's full-sized avatar

Mauro Porras mauroporras

  • Medellín - Colombia
View GitHub Profile
{
"error": "unauthorized",
"reason": "You are not a server admin."
}
const PouchDB = require('pouchdb')
const db = new PouchDB('zeainc')
const remote = 'http://admin:password@localhost:5984/zeainc/projets'
db.changes({
since: 'now',
live: true,
}).on('change', listProjects)
#!/usr/bin/env ruby
class Fixnum
def holes
if abs > 9
to_s.chars.reduce(0) { |a, e| a += e.to_i.holes }
else
case self
when 1, 2, 3, 5, 7
0
class Fixnum
def is_zero_one?
self.to_s.chars.all? { |e| '01'.include? e }
end
def smallest_zero_one
unless (1...100_000).include?(self)
fail ArgumentError.new('Integer should be between 1 and 99,999')
end
@mauroporras
mauroporras / start-jee-war.bat
Created May 5, 2012 04:43
bat,tomcat,war: Starts a WAR precopied to the Apache Tomcat webapps directory and opens the Google Chrome portable version
@echo off
SET JAVA_HOME=".\jdk1.7.0_04"
SET CATALINA_HOME=".\apache-tomcat-7.0.27"
CALL ".\apache-tomcat-7.0.27\bin\startup.bat"
".\GoogleChromePortable\GoogleChromePortable.exe" --app="http://localhost:8080/my-webapp/"