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 bl = require('bl'); | |
| module.exports = function(url, callback) { | |
| var result = ''; | |
| http.get(url, function(res) { | |
| res.setEncoding('utf8'); | |
| res.pipe(bl(function(err, data) { | |
| result += data.toString(); |
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 args = process.argv.slice(2); | |
| var httpPipe = require('./http_pipe'); | |
| httpPipe(args[0], function(err, data) { | |
| if (err) throw err; | |
| console.log(data.length); | |
| console.log(data); | |
| }); |
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 args = process.argv.slice(2); | |
| var httpGet = require('./http_get'); | |
| httpGet(args[0], function(err, data) { | |
| if (err) throw err; | |
| console.log(data); | |
| }); |
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'); | |
| module.exports = function(url, callback) { | |
| http.get(url, function(res) { | |
| res.setEncoding('utf8'); | |
| res.on('data', function(buf) { | |
| callback(null, buf.toString()); | |
| }); |
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
| #!/bin/sh | |
| basedir=`dirname "$0"` | |
| case `uname` in | |
| *CYGWIN*) basedir=`cygpath -w "$basedir"`;; | |
| esac | |
| if [ -x "$basedir/node" ]; then | |
| "$basedir/node" "$basedir/../jade/bin/jade.js" "$@" | |
| ret=$? |
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 | |
| head | |
| title= title | |
| link(rel='stylesheet', href='/stylesheets/style.css') | |
| body | |
| block content |
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
| public class HttpAsyncTask extends AsyncTask<URL, Integer, String> { | |
| /** | |
| * <URL, Integer, String> — URL::URL, Progress Report::Integer, Result::String | |
| */ | |
| private final String LOG_TAG = TestAsyncTask.class.getSimpleName(); | |
| public static final String POST_REQUEST_NAME = "POST"; | |
| public static final String GET_REQUEST_NAME = "GET"; |
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
| package ru.twosphere.android.misisbooks; | |
| import android.util.Log; | |
| import org.json.JSONArray; | |
| import org.json.JSONException; | |
| import org.json.JSONObject; | |
| /** | |
| * Created by Александр on 31.01.2015. |
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 android.net.Uri; | |
| import android.os.AsyncTask; | |
| import android.util.Log; | |
| import org.json.JSONException; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; |
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
| else if (match[4]) { // URL & e-mail | |
| if (!options.noLinks) { | |
| var matchEmojiInURL; | |
| if (match[4].match(emojiRegex)) { | |
| if (matchEmojiInURL = match[4].match(emojiRegex)) { | |
| if ((emojiCode = emojiMap[matchEmojiInURL[0]]) && | |
| (emojiCoords = getEmojiSpritesheetCoords(emojiCode))) { | |
| emojiTitle = encodeEntities(emojiData[emojiCode][1][0]); | |
| emojiFound = true; |