Skip to content

Instantly share code, notes, and snippets.

Jordan Pittman thecrypticace

Block or report user

Report or block thecrypticace

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thecrypticace
thecrypticace / colors.swift
Created Dec 1, 2018
Tailwind Colors interpreted as Display P3 converted to sRGB
View colors.swift
// Why?
// Figma (as of this writing) doesn't have color management
// As a result of this when using hex values intended for sRGB the colors end up much richer on a P3 display
// If you throw them into a color managed browser you're not going to get what you expect. It'll look washed out.
// This is a best approximation of the colors by interpeting as Display P3 and converting to sRGB
// Some colors are not fully representable (and are marked as such by noting which channels were clipped)
// h/t to Marc Edwards for pointing me in the right direction on how to do this. Thanks!
import Cocoa
View gist:391888088b806dae7a871caf905bcec1
=== RUN TestNextToken
=== RUN TestNextToken/{,}
=== RUN TestNextToken/{a,}
=== RUN TestNextToken/{ab,c}
=== RUN TestNextToken/{1..10}
=== RUN TestNextToken/{1...10}
panic: runtime error: slice bounds out of range [recovered]
panic: runtime error: slice bounds out of range
goroutine 24 [running]:
View imap-fetch.php
<?php
use Fetch\Server;
// https://github.com/tedious/Fetch
$server = new Server("outlook.office365.com", 993);
$server->setAuthentication("myemail@domain.com", "mypassword");
$server->setFlag("novalidate-cert");
$server->setParam("DISABLE_AUTHENTICATOR", ["PLAIN"]);
@thecrypticace
thecrypticace / settings.json
Last active Oct 23, 2017
VSCode Integrated Terminal Customizations
View settings.json
{
"workbench.colorCustomizations": {
"terminalCursor.foreground": "#fee381",
"terminal.selectionBackground": "#cb392e",
"terminal.background": "#0d151b",
"terminal.foreground": "#ffffff",
"terminal.ansiBlack": "#3c444d",
"terminal.ansiBlue": "#266b85",
"terminal.ansiBrightBlack": "#515d68",
"terminal.ansiBrightBlue": "#329dcc",
View Combinations.php
<?php
class Combinations
{
public static function unique($values, $minLength = 1, $maxLength = null)
{
// $combinations is an array of [["a"], ["a"], … ["a", "b"], ["a", "b", "c"], …]
// The array may not be sorted. Each internal array IS sorted.
// Keys produced by the generator are sequential but shouldn't matter
@thecrypticace
thecrypticace / InteractsWithExceptionHandling.php
Last active Mar 6, 2017
Enhanced version of exception handler replacement
View InteractsWithExceptionHandling.php
<?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 Jan 22, 2017
Fix yarn transitive dependency binaries
View fix-yarn
#!/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;
View tokens.php
<?php
$entries = json_decode(file_get_contents("whatever.json"), true);
$tokensPerEntry = array_map(function ($entry) {
return $entry["requirements"]["others"];
}, $entries);
$tokens = array_merge([], ...$tokensPerEntry);
View keybase.md

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:

You can’t perform that action at this time.