An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| """ | |
| This example requires the body-streaming tornado fork at https://github.com/nephics/tornado. | |
| Refer to http://groups.google.com/group/python-tornado/browse_thread/thread/791c67cb86c2dea2. | |
| Supports uploading an unlimited number/size of files in a single | |
| PUT multipart/form-data request. Each file is processed as the stream | |
| finds the part in the form data. | |
| ==USAGE== |
| # (c) 2012 [neocotic](http://github.com/neocotic) | |
| # Freely distributable under the MIT license. | |
| # Private constants | |
| # ----------------- | |
| # Code for extension's analytics account. | |
| ACCOUNT = 'UA-12345678-1' | |
| # Source URL of the analytics script. | |
| SOURCE = 'https://ssl.google-analytics.com/ga.js' |
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| */ | |
| var http = require('http'), | |
| fs = require('fs'), | |
| util = require('util'); | |
| http.createServer(function (req, res) { | |
| var path = 'video.mp4'; |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| var fs = require("fs"); | |
| var path = require("path"); | |
| var rmdir = function(dir) { | |
| var list = fs.readdirSync(dir); | |
| for(var i = 0; i < list.length; i++) { | |
| var filename = path.join(dir, list[i]); | |
| var stat = fs.statSync(filename); | |
| if(filename == "." || filename == "..") { |
| app.use(require('connect-flash')()); | |
| // Expose the flash function to the view layer | |
| app.use(function(req, res, next) { | |
| res.locals.flash = function() { return req.flash() }; | |
| next(); | |
| }) |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |
| <!-- | |
| This configuration file was written by the eclipse-cs plugin configuration editor | |
| --> | |
| <!-- | |
| Checkstyle-Configuration: Android Checks (Eclipse) | |
| Description: | |
| Slightly modified version of Sun Checks that better matches the default code formatter setting of Eclipse. |
| var Benchmark = require('benchmark'); | |
| Benchmark.prototype.setup = function() { | |
| a = ["test"]; | |
| for (var i = 0; i < 10000; i++) { | |
| a.push("some other stuff"); | |
| } | |
| s = a.join(); | |
| re1 = new RegExp("^test"); | |
| re2 = new RegExp("^not there"); | |
| }; |
| var request = require('supertest'), | |
| should = require('should'), | |
| app = require('../server'); | |
| var Cookies; | |
| describe('Functional Test <Sessions>:', function () { | |
| it('should create user session for valid user', function (done) { | |
| request(app) | |
| .post('/v1/sessions') |