This Gist includes some of the common AWS/IAM policy examples to give granular access to users.
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
| package com.vaibhavpandey; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| class StrRev { | |
| static Pattern AZ = Pattern.compile("[a-zA-Z]+"); | |
| static String reverse(String string) { |
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
| from sentence_transformers import SentenceTransformer | |
| EMBEDDING_MODEL = "BAAI/bge-large-en-v1.5" | |
| model = SentenceTransformer(EMBEDDING_MODEL) | |
| embeddings = model.encode(sentences=["Hey", "How are you?"], normalize_embeddings=True) |
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
| using System; | |
| using System.Linq; | |
| using System.Management; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| namespace DeviceID | |
| { | |
| internal class Fingerprint | |
| { |
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
| FROM alpine:3 | |
| RUN apk update && apk upgrade | |
| RUN apk add --no-cache chromium chromium-chromedriver | |
| RUN mkdir -p /usr/src/app \ | |
| && adduser -D chromium \ | |
| && chown -R chromium:chromium /usr/src/app |
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
| function getCsrfToken() { | |
| var parts = ('; ' + document.cookie) | |
| .split("; csrf="); | |
| if (parts.length === 2) { | |
| const value = parts.pop().split(";").shift(); | |
| return decodeURIComponent(value); | |
| } | |
| } | |
| function sendXhr(url, method, data = null, headers = {}) { |
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 | |
| /** | |
| * @param string|null $number | |
| * @return string|null | |
| */ | |
| function normalize_to_e164(?string $number): ?string | |
| { | |
| if (empty($number)) { | |
| return null; |
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
| FROM ubuntu | |
| WORKDIR /meilisearch | |
| RUN apt-get update && \ | |
| apt-get install -y libc6-dev wget | |
| RUN wget -O exe https://github.com/meilisearch/MeiliSearch/releases/download/v0.12.0/meilisearch-linux-armv8 && \ | |
| chmod a+x exe |
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 | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Support\Str; | |
| trait HasUuidAsPrimaryKey | |
| { | |
| public static function bootHasUuidAsPrimaryKey() | |
| { | |
| static::creating(function (Model $model) { |
NewerOlder