This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"error": "unauthorized", | |
"reason": "You are not a server admin." | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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/" |