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
syntax = "proto3"; | |
package entpb; | |
import "options/opts.proto"; | |
import "google/protobuf/timestamp.proto"; | |
option go_package = "github.com/yourorg/project/ent/proto/entpb"; | |
message User { |
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 env | |
import ( | |
"bufio" | |
"errors" | |
"fmt" | |
"io" | |
"os" | |
"regexp" | |
"strings" |
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 boto3 | |
import datetime | |
# Amazon Cognito User Pool Configs | |
LIMIT = 60 | |
REGION = 'us-east-1' | |
USER_POOL_ID = 'us-east-1_aaaaaaaaa' | |
# Create boto3 CognitoIdentityProvider client | |
client = boto3.client('cognito-idp', REGION) |
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 prisma | |
type EntityQuery struct { | |
QueryInterface | |
} | |
// implementing into model struct | |
// not as INTERFACE, to use inheritance. | |
// we can still customize funcs if needed |
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
bringFocusInsideOverlay() { | |
return requestAnimationFrame(() => { | |
// Container ref may be undefined between component mounting and Portal rendering | |
// activeElement may be undefined in some rare cases in IE | |
if ( | |
this.$refs.container == null || | |
document.activeElement == null || | |
!this.isShown | |
) { | |
return |
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
type FilterChain = { | |
func: Function | |
args: any[] | |
} | |
type FrameBuffer = { | |
fbo: WebGLFramebuffer | null | |
texture: WebGLTexture | 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
// Creditcard a creditcard holds information | |
// about a card from StripeJS | |
// card brand | |
type Creditcard struct { | |
ID string `json:"id" db:"id"` | |
// Can be amex, diners, discover, jcb, mastercard, unionpay, visa, or unknown | |
Brand string `json:"brand" db:"brand"` | |
Checks Checks `json:"checks" has_one:"checks" fk_id:"credit_card_id"` | |
Country string `json:"country" db:"country"` | |
// Two-digit number representing the card’s expiration month. |
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
[{ | |
"name": "Afghanistan", | |
"topLevelDomain": [".af"], | |
"alpha2Code": "AF", | |
"alpha3Code": "AFG", | |
"callingCodes": ["93"], | |
"capital": "Kabul", | |
"altSpellings": ["AF", "Afġānistān"], | |
"region": "Asia", | |
"subregion": "Southern Asia", |
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 | |
public function convertToUtf8 ($el) { | |
if (is_array($el)) { | |
foreach ($el as $key => $value) { | |
if (is_array($el[$key])) { | |
$el[$key] = $this->convertToUtf8($value); | |
} else { | |
$el[$key] = utf8_encode($value); | |
} |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
NewerOlder