Giter Site home page Giter Site logo

table-flip's Introduction

Inspired by Adam Harvey: https://twitter.com/LGnome/status/735573024825430016

if ($situation === SHIT::HAPPENED) {(╯°□°)╯︵┻━┻(); }

Usages:

  • throw new (╯°□°)╯︵┻━┻; // TableFlip
  • throw new (ノ゜Д゜)ノ︵┻━┻; // PudgyTableFlip
  • throw new (ノಥ益ಥ)ノ︵┻━┻; // AgroTableFlip
  • (╯°□°)╯︵┻━┻(); // Function shorthand
  • assert((╯°□°)╯︵┻━┻() ); // Use in an assert to only flip in dev

All three table-flip classes extend \Exception and implement the ┻━┻ interface, so the following works:

try {
  $ret = doSomething();
  if ($ret === null) {
    throw new (╯°□°)╯︵┻━┻;
  } elseif ($ret === false) {
    throw new (ノಥ益ಥ)ノ︵┻━┻;
  } elseif (!is_string($ret)) {
    throw new (ノ゜Д゜)ノ︵┻━┻;
  }
} catch (┻━┻ $e) {
  ┬─┬ノ(・_・ノ);
}

Note that the parentheses used in the class/function names here are U+FF08 FULLWIDTH LEFT PARENTHESIS and U+FF09 FULLWIDTH RIGHT PARENTHESIS since normal parens (U+0028/U+0029) are not allowed in PHP labels.

Similarly, the customary space is omitted entirely to make this a valid PHP label.

table-flip's People

Contributors

ayesh avatar chrisemerson avatar colinodell avatar d3y4n avatar dstockto avatar dusankasan avatar hikari-no-yume avatar sgolemon avatar simonwelsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

table-flip's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.