This file contains 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
#!/usr/bin/env ruby | |
unless ARGV.length == 2 | |
puts "Dude, not the right number of arguments." | |
puts "Usage: ruby htpassword.rb username 'password'\n" | |
exit | |
end | |
username = ARGV[0] | |
passwd = ARGV[1] |
This file contains 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
<?php | |
/** | |
* A basic autoload implementation that should be compatible with PHP 5.2. | |
* | |
* @author pmg | |
*/ | |
global $autoLoadFolders; |
This file contains 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
<?php | |
namespace Acme; | |
class DateTimeTest extends \PHPUnit_Framework_TestCase | |
{ | |
/** @test */ | |
public function it_creates_from_unix_timestamp() | |
{ | |
$unix = time(); |
This file contains 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
<?php | |
namespace App\Http\Controllers; | |
use App\Result; | |
use Illuminate\Http\Request; | |
use Symfony\Component\HttpFoundation\StreamedResponse; | |
class ExportController extends Controller | |
{ |
This file contains 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
<?php | |
namespace App\Http\Controllers; | |
use Laravel\Lumen\Routing\Controller; | |
use Symfony\Component\HttpFoundation\StreamedResponse; | |
class ApiController extends Controller | |
{ | |
/** |
This file contains 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
<?php | |
namespace App\Acme; | |
abstract class Transformer | |
{ | |
public function transformCollection(array $items) | |
{ | |
return array_map([$this, 'transform'], $items); | |
} |
This file contains 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
<snippet> | |
<content><![CDATA[ | |
namespace Tests; | |
class ${TM_FILENAME/(.+)\..+|.*/$1/:name} extends \PHPUnit_Framework_TestCase | |
{ | |
public function setUp() | |
{ | |
} |
This file contains 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
Show hidden characters
{ | |
"presets": [ | |
[ | |
"env", | |
{ | |
"modules": false, | |
"targets": { | |
"browsers": [ | |
"> 1%", | |
"last 2 versions", |
This file contains 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
{ | |
"plugins": [ | |
"jasmine", | |
"vue" | |
], | |
"env": { | |
"browser": true, | |
"es6": true, | |
"jasmine": true | |
}, |
This file contains 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
pollProgress(timeout, interval) { | |
let endTime = Number(new Date()) + (timeout || 3 * 1000 * 60) | |
interval = interval || 1000 | |
let checkCondition = (resolve, reject) => { | |
this.fetchProgress(this.progressToken) | |
.then((response) => { | |
if (response.data.percentage >= 100) { | |
resolve(response) | |
} else if (Number(new Date()) < endTime) { | |
setTimeout(checkCondition, interval, resolve, reject) |
OlderNewer