Skip to content

Instantly share code, notes, and snippets.

View DracoBlue's full-sized avatar

DracoBlue

View GitHub Profile
@DracoBlue
DracoBlue / my-first-goto.php
Last active December 16, 2015 01:49 — forked from hoffigk/my-first-goto.php
goto without goto ;)
<?php
function createFoo()
{
$pdo = new PDO(/*...*/);
$maxTryCount = 3;
$tryCount = $maxTryCount;
while ($tryCount > 0)
{
@DracoBlue
DracoBlue / API.md
Created October 1, 2012 15:25 — forked from graste/API.md
Documenting your REST API

Hint: This is heavily based on https://gist.github.com/3428555.

Api Name

Title: METHOD URL

Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple). The request type and the URL Structure (path only, no root url). METHOD may be GET | POST | DELETE | PUT.

@DracoBlue
DracoBlue / .gitignore
Created June 11, 2012 11:36 — forked from evelynmitchell/.gitignore
comfortable shell script for running TWS
*~
*.o
var one = 'http://blah'
, two = '/asdf/asdf/af'
;
function regexTest () {
var start = new Date();
var i = 0;
while (i<1000000) {
if ( !/^http?:/.test(one) ) true
if ( !/^http?:/.test(two) ) true