This file contains hidden or 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
exports.putById = function (req, res){ | |
console.log(req.body); | |
regModel.findById(req.params.id, function (err, entry) { | |
for (key in req.body){ | |
entry[key] = req.body[key]; | |
} | |
entry.save(function (err) { | |
if (!err) { | |
console.log("updated"); |
This file contains hidden or 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
require( './routes/model_db' ); | |
var express = require('express'); | |
var routes = require('./routes'); | |
var http = require('http'); | |
var path = require('path'); | |
var app = express(); |
This file contains hidden or 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
extends layout | |
block content | |
article | |
div.addCommentForm | |
form( method="post", action="/api/entries") | |
div | |
div | |
span.label Name : | |
input(name="name") |
This file contains hidden or 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
doctype html | |
html(lang='es') | |
head | |
meta(charset='utf-8') | |
meta(name='description', content='APIRest_test') | |
meta(name='keywords', content='API, rest, node, mongo, mongoose, html5, express') | |
title= title | |
link(rel='stylesheet', href='/stylesheets/style.css') | |
script(type="text/javascript", src="http://code.jquery.com/jquery-1.11.0.min.js") |
This file contains hidden or 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
$(document).ready(function(){ | |
$('input#update').click(function() { | |
var clave = $('#keys').val(); | |
var valor = $('#value').val(); | |
var arr = {}; | |
arr[clave] = valor; | |
console.log(arr); |
This file contains hidden or 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
@import url("http://fonts.googleapis.com/css?family=Lato:100,300,400,700"); | |
html, | |
body, | |
div, | |
span, | |
object, | |
iframe, | |
h1, | |
h2, | |
h3, |
This file contains hidden or 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 contains(arr, element) { | |
var i = arr.length; | |
var elementToInt = parseInt(element, 10); | |
while (i--) { | |
if ( arr[i] === elementToInt) { | |
return true; | |
} | |
} | |
return false; | |
} |
This file contains hidden or 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
/*global $, Backbone, window, console, WebSocket, _ */ | |
$(function () { | |
"use strict"; | |
// for better performance - to avoid searching in DOM | |
var $content = $('#content') | |
, $input = $('#input') | |
, $status = $('#status') | |
// my color assigned by the server |
This file contains hidden or 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 dimensionSize = { | |
mma: { width: 300, height: 50 }, | |
medrect: { width: 300, height: 250 }, | |
xxlarge: { width: 320, height: 50 }, | |
xlarge: { width: 300, height: 50 }, | |
sky: { width: 120, height: 600 }, | |
widesky: { width: 160, height: 600 }, | |
leader: { width: 728, height: 90 }, | |
full_320x480: { width: 320, height: 480 }, | |
full_480x320: { width: 480, height: 320 }, |
This file contains hidden or 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
import React from 'react'; | |
import { mount } from 'enzyme'; | |
import LoginForm from 'components/LoginForm'; | |
const credentials = { username: '[email protected]', password: 'testpass' }; | |
const test = jest.fn(); | |
function setup() { | |
// Modal fix | |
const div = document.createElement('div'); |