Skip to content

Instantly share code, notes, and snippets.

@ivankruchkoff
ivankruchkoff / index.js
Created December 24, 2021 01:59 — forked from bnerd/index.js
Serve large files with Node.js
var libpath = require('path');
var http = require('http');
var fs = require('fs');
var url = require('url');
var bind_port = 8001;
var path = "/path/to/your/base_directory/";
http.createServer(function (request, response) {
var uri = url.parse(request.url).pathname;
var filename = libpath.join(path, uri);
@ivankruchkoff
ivankruchkoff / news_0003607.json
Created July 22, 2017 19:45
news_0003607.json
{
"uuid" : "3057736497e653ace132201af03e2f5144759e06",
"author" : "",
"language" : "english",
"highlightTitle" : "",
"external_links" : [],
"thread" : {
"title_full" : "Gigi bares it all for mag cover!",
"site" : "rediff.com",
"performance_score" : 0,
@ivankruchkoff
ivankruchkoff / pr.md
Created June 23, 2017 12:46 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ivankruchkoff
ivankruchkoff / .jshintrc
Created November 2, 2015 16:35
.jshintrc
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,