Install the netcat nc
command with Homebrew (otherwise Mac OS X version is really old and the interface is different):
brew install netcat
Use netcat to listen for incoming TCP connections on port 3000:
nc -l -p 3000
Install the netcat nc
command with Homebrew (otherwise Mac OS X version is really old and the interface is different):
brew install netcat
Use netcat to listen for incoming TCP connections on port 3000:
nc -l -p 3000
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:
Look at the following image...
...it shows an object being tested.
You can't see inside the object. All you can do is send it messages. This is an important point to make because we should be "testing the interface, and NOT the implementation" - doing so will allow us to change the implementation without causing our tests to break.
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
function( | |
a, // a object holding test functions | |
b, // a logging function, taking multiple arguments | |
c, // placeholder | |
d, // placeholder | |
e, // placeholder | |
f // placeholder | |
){ | |
c = d = e = 0; // initialize asserts, failures and exception counts to 0 | |
for ( // iterate |
"""Demonstration of server-sent events with Tornado. To see the | |
stream, you can either point your browser to ``http://localhost:8080`` | |
or use ``curl`` like so:: | |
$ curl http://localhost:8080/events | |
""" | |
import signal | |
from tornado import web, gen |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
#!/usr/bin/env node | |
var request = require("request"); | |
var exec = require("child_process").exec; | |
if (process.argv.length < 3) { | |
console.log("Missing username argument"); | |
} | |
var username = process.argv[2]; |