Skip to content

Instantly share code, notes, and snippets.

View thecrypticace's full-sized avatar

Jordan Pittman thecrypticace

View GitHub Profile
@thecrypticace
thecrypticace / InteractsWithExceptionHandling.php
Last active March 6, 2017 02:27
Enhanced version of exception handler replacement
<?php
namespace Tests\Concerns;
use Exception;
use Throwable;
use App\Exceptions\Handler;
use Illuminate\Contracts\Debug\ExceptionHandler;
trait InteractsWithExceptionHandling
@thecrypticace
thecrypticace / fix-yarn
Last active January 22, 2017 23:58
Fix yarn transitive dependency binaries
#!/usr/bin/env php
<?php
file_exists("node_modules/.bin") || mkdir("node_modules/.bin");
chdir("node_modules/.bin");
foreach (glob("../*/bin/*") as $file) {
if (! is_executable($file)) {
continue;
<?php
$entries = json_decode(file_get_contents("whatever.json"), true);
$tokensPerEntry = array_map(function ($entry) {
return $entry["requirements"]["others"];
}, $entries);
$tokens = array_merge([], ...$tokensPerEntry);

Keybase proof

I hereby claim:

  • I am thecrypticace on github.
  • I am thecrypticace (https://keybase.io/thecrypticace) on keybase.
  • I have a public key ASDCy4Hw5zzX0ThF5TzoFIAtbdyFB-79Wfk6cJ2pnCAGzgo

To claim this, I am signing this object:

@thecrypticace
thecrypticace / Terminal Output
Last active February 8, 2017 19:26
Elixir 6.0.0 RC2 Combine error
$ node -v
v5.11.0
$ npm -v
3.8.6
$ gulp
/Users/me/Code/project/node_modules/parse-filepath/index.js:8
throw new Error('parse-filepath expects a string.');
^
<?php
header("Content-Type:text/plain");
/* Escaping Challenge: Make a PHP script that (Z:) generates JavaScript code
* that generates an HTML page containing a PHP script that (goto Z) */
/* The purpose of this challenge is to demonstrate how complicated escaping can
* get when you're trying to combine 4 different languages (PHP, JavaScript,
* HTML, and string literals). */
function js_string_escape($data)