https://eng.lyft.com/using-mapper-to-parse-json-in-swift-7788d5c57d74#.56du771tb http://blog.udacity.com/2015/03/learn-swift-tutorial-fundamentals.html https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=908519492&mt=8&ls=1
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
<!-- index.html --> | |
<html> | |
<head> | |
<title>Votacao Real-time</title> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
var socket = io.connect('http://localhost:5000'); | |
socket.on('toClient', function (votacao) { | |
console.log(votacao); |
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
npm install --save mongodb request request-promise | |
var request = require('request'); | |
var rp = require('request-promise'); | |
var db = require('mongodb').MongoClient; | |
let key = '246bf886104d519a1d2bf62aef1054ff'; | |
router.get('/update-em-cartaz', function(req, res, next) { | |
rp('http://api.themoviedb.org/3/movie/now_playing?page=1&api_key='+key) |
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
[ | |
{ | |
"name":"Bulbasaur", | |
"attack":49, | |
"defense":49, | |
"evolveLevel":16, | |
"evolveTo":"2", | |
"type":"grass", | |
"moves":[ | |
"tackle", |
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
<?php | |
function curl_get_contents($url){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
return $data; | |
} |
##Documentação https://developers.themoviedb.org/3/movies
##API http://api.themoviedb.org/3/
##Token 246bf886104d519a1d2bf62aef1054ff
##Imagens
https://developers.facebook.com/docs/messenger-platform/send-api-reference
curl -X POST -H "Content-Type: application/json" -d '{
"recipient": {
"id": "USER_ID"
},
"message": {
"text": "hello, world!"
}
}' "https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN"
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 http = require('http'); | |
var fs = require('fs'); | |
var server = http.createServer(function(request, response) { | |
fs.readFile(__dirname + '/index.html', function(err, html) { | |
response.writeHeader(200, { | |
'Content-Type': 'text/html' | |
}); | |
response.write(html); | |
response.end(); | |
}); |
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 fs = require('fs'), | |
http = require('http'); | |
http.createServer(function (req, res) { | |
fs.readFile(__dirname + req.url, function (err,data) { | |
if (err) { | |
res.writeHead(404); | |
res.end(JSON.stringify(err)); | |
return; | |
} |
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 fs = require('fs'); | |
fs.stat('data.txt', function (err, stats) { | |
if (err) | |
throw err; | |
if (stats.isFile()) { | |
console.log('É um arquivo!'); | |
} | |
if (stats.isDirectory()) { | |
console.log('É um diretório!'); | |
} |