This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
PEAR Channel Server hosted by GitHub | |
==================================== | |
This is my PEAR Channel Server hosted by GitHub and powered by [Pirum](http://www.pirum-project.org): | |
[jsor.github.com/pear](http://jsor.github.com/pear) | |
Create your own PEAR Channel Server | |
----------------------------------- |
A simple script that estimates the progress, speed and probable completion time of a copy operation. | |
It was originally written for a QNAP NAS running busybox, but should be compatible with any busybox install. | |
Should also work for most Linux systems, but the options to du and df will have to be modified since the busybox uses a simplified syntax (The -m for both of them is to get the output in MB). | |
The script is called with the same arguments given to cp | |
The script estimates by using: | |
- Difference in df-used for speed | |
- Difference in du for percentage | |
- A combination of the above for ETC (Estimated Time to Completion) |
import ast | |
from cStringIO import StringIO | |
import sys | |
INFSTR = '1e308' | |
def interleave(inter, f, seq): | |
seq = iter(seq) | |
try: | |
f(next(seq)) |
/*global console window describe xdescribe it expect runs waits*/ | |
(function () { | |
require.paths.unshift(__dirname + '/../../../'); | |
require('thorny/base')('./config/default.json')(function ($) { | |
describe('a vector2', function () { | |
it('should contain the following functions', function () { | |
var vector2 = $('thorny math vector2'); | |
expect(typeof vector2.factory).toEqual('function'); | |
expect(typeof vector2.centroid).toEqual('function'); |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
<?php | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Symfony\Bundle\FrameworkBundle\Console\Application; | |
use Behat\BehatBundle\Command\BehatCommand; | |
class BehatTest extends KernelAwareTest | |
{ | |
/** |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |