I’m documenting for myself what I would look for in a validation library. The code I currently need it for is in Kotlin so I have the entire JVM ecosystem to choose from.
This file contains hidden or 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 python3 | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| see: https://gist.github.com/UniIsland/3346170 | |
| """ | |
This file contains hidden or 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
| // loop that generates margin ad padding helper classes | |
| // the output is like .margin-5, .margin-top-5, margin-right-5 etc... | |
| $properties: (margin, padding); | |
| $sides: (top, right, bottom, left); | |
| @each $prop in $properties { | |
| @for $i from 1 through 14 { | |
| .#{$prop}-#{$i*5} { | |
| #{$prop}: #{$i*5}px !important; | |
| } | |
| @each $side in $sides { |
This file contains hidden or 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
| /** | |
| * Returns the global object. | |
| * Works even inside ES6 modules. | |
| */ | |
| function getGlobalObject() { | |
| // Workers don’t have `window`, only `self` | |
| if (typeof self !== 'undefined') { | |
| return self; | |
| } | |
| if (typeof global !== 'undefined') { |
This file contains hidden or 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
| import java.nio.ByteBuffer; | |
| import java.util.UUID; | |
| public class UuidAdapter { | |
| public static byte[] getBytesFromUUID(UUID uuid) { | |
| ByteBuffer bb = ByteBuffer.wrap(new byte[16]); | |
| bb.putLong(uuid.getMostSignificantBits()); | |
| bb.putLong(uuid.getLeastSignificantBits()); | |
| return bb.array(); |
This file contains hidden or 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\Util\Doctrine\Repository; | |
| use App\Util\Doctrine\Entity\AbstractEntity; | |
| use Doctrine\Common\Persistence\ObjectRepository; | |
| use Doctrine\ORM\EntityRepository; | |
| use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |
| use Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException; |
This file contains hidden or 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
| #!/bin/bash | |
| set -e | |
| CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
| hex=$((cat <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> |
This file contains hidden or 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
| @import Darwin; | |
| @import ObjectiveC; | |
| @import CloudKit; | |
| extern bool GEOConfigGetBOOL(int feature, void* something); | |
| // Hooks feature flags in a resigned Maps.app to return true. | |
| // Usage: | |
| // clang -shared -fmodules -o libmaps_inject.dylib maps_inject.m \ | |
| // "$(xcrun |
OlderNewer