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
FROM ubuntu | |
MAINTAINER Max Claus Nunes | |
RUN apt-get install -y python-software-properties python | |
RUN add-apt-repository ppa:chris-lea/node.js | |
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y nodejs | |
#RUN apt-get install -y nodejs=0.6.12~dfsg1-1ubuntu1 | |
RUN mkdir /var/www |
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
vagrant@srv:/srv/my-project$ npm install | |
npm http GET https://registry.npmjs.org/factory-mysql-fixtures | |
npm http 304 https://registry.npmjs.org/factory-mysql-fixtures | |
npm ERR! notarget No compatible version found: factory-mysql-fixtures@'maxcnunes/factory-mysql-fixtures' | |
npm ERR! notarget Valid install targets: | |
npm ERR! notarget ["0.0.2"] | |
npm ERR! notarget | |
npm ERR! notarget This is most likely not a problem with npm itself. | |
npm ERR! notarget In most cases you or one of your dependencies are requesting | |
npm ERR! notarget a package version that doesn't exist. |
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
function Produto(nome, qtd){ | |
var self = this; | |
self.Nome = nome || ''; | |
self.Qtd = qtd || 0; | |
return self; | |
} | |
var arroz = new Produto("Arroz", 10); |
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
# 1. discover what is wrong | |
sudo nginx -t | |
# 2. fix everything | |
# 3. restart the service | |
sudo service nginx restart |
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
mkdir -p site-cookbooks/tomatoes/{recipes,{templates,files}/default} |
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
# with netstat | |
netstat -nlp | grep :80 | |
# or with lsof | |
lsof -i :80 | grep LISTEN | |
# http://www.cyberciti.biz/faq/find-linux-what-running-on-port-80-command/ |
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
# generate ssh key | |
ssh-keygen -t dsa | |
# (Don’t enter a passphrase unless you want to type it every time you want to use the key) | |
# set permissions | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/id_dsa | |
chmod 644 ~/.ssh/id_dsa.pub | |
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
# Add this to you ~/.profile | |
function tree { | |
find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' | |
} | |
# Then: | |
$ source ~/.profile | |
$ tree |
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
var request = require('supertest'), | |
mongoose = require('mongoose'), | |
app = require('../../../../server'); | |
describe('GET /api/transactions/import', function(){ | |
before(function (done) { | |
mongoose.connection.on('open', done); | |
}); | |
it('respond with json', function(done){ |
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
private class Screen | |
{ | |
Form mainForm = ... | |
private void Screen_Loaded(object sender, ControlLoadedEventArgs e) | |
{ | |
if(mainForm.InputControls != null && mainForm.InputControls.Contains("Id")) | |
mainForm.InputControls["Id"].Editable = isEditable; | |
} | |
} |