Skip to content

Instantly share code, notes, and snippets.

View devalexandre's full-sized avatar
🎯
Focusing

Alexandre E. Souza devalexandre

🎯
Focusing
View GitHub Profile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use mysql as the database for Active Record
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Server running on http://127.0.0.1:8000
Quit the server with CONTROL-C.
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: is_file(): open_basedir restriction in effect. File(/usr/bin/php)
is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear
/:/usr/share/webapps/)
<?php
public function newAction($id)
{
$entity = new Entrada();
$material = new Material($id);
$entity->setMaterial($material);
$form = $this->createCreateForm($entity);
<?php
public function newAction($id)
{
$entity = new Entrada();
$material = new Material($id);
$entity->setMaterial($material);
$form = $this->createCreateForm($entity);
[root@progs alexandre]# mongo
MongoDB shell version: 3.0.7
connecting to: test
2015-10-16T14:49:17.822+0000 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-10-16T14:49:17.826+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
function onEdit($param)
{
try
{
if (isset($param['key']))
{
$key=$param['key']; // get the parameter $key
TTransaction::open('sample'); // open a transaction
$object = new Clientes($key); // instantiates the Active Record
$obj = new stdClass();
#!/bin/env node
// OpenShift sample Node application
var express = require('express');
var fs = require('fs');
var app = express();
var site = require('./routers/site');
// seta onde ficaram as views
var express = require('express');
var router = express.Router();
// middleware specific to this router
router.use(function timeLog(req, res, next) {
console.log('Time: ', Date.now());
next();
});
// define the home page route
router.get('/', function(req, res) {
// grab the things we need
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var postSchema = new Schema({
title : {type:String, required:true},
content : {type:String, required:true},
categories:{
name: {type:String, required:true},
var express = require('express');
var router = express.Router();
var Post = require('../models/poemas');
/* GET home page. */
router.get('/', function(req, res, next) {
var Menestrel = new Poemas({
title: "O Menetrel",