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
| WITH RECURSIVE c AS ( | |
| SELECT id, name, username, sponsor, parent_id, root_node_path, 0 as lvl | |
| FROM users | |
| WHERE id = 1 and root_node_path is not null | |
| UNION ALL | |
| SELECT users.id, users.name, users.username, users.sponsor, users.parent_id, users.root_node_path, c.lvl + 1 as lvl | |
| FROM users | |
| JOIN c ON ltree2text(subpath(users.root_node_path,nlevel(users.root_node_path)-2 ,nlevel(users.root_node_path))) = CONCAT(subpath(c.root_node_path,nlevel(c.root_node_path)-1,nlevel(c.root_node_path)),'.',users.id) | |
| ), | |
| maxlvl AS ( |
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 _ from 'lodash'; | |
| export default function UFCityBrazilService() { | |
| const UFCity = [ | |
| { | |
| abbreviation: 'AC', | |
| name: 'Acre', | |
| city: [ | |
| 'Acrelândia', |
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
| option_settings: | |
| aws:elb:listener:443: | |
| ListenerProtocol: HTTPS | |
| SSLCertificateId: arn:aws:acm:sa-east-1:890777365147:certificate/fe1ea2dc-809a-4fae-b682-beeeed806dff | |
| InstancePort: 80 | |
| InstanceProtocol: HTTP | |
| aws:elb:listener:80: | |
| InstancePort: '80' | |
| InstanceProtocol: HTTP | |
| ListenerEnabled: '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
| { | |
| "AWSEBDockerrunVersion": "1", | |
| "Image": { | |
| "Name": "<AWS_ACCOUNT_ID>.dkr.ecr.<AWS_REGION>.amazonaws.com/<NAME>:<TAG>", | |
| "Update": "true" | |
| }, | |
| "Ports": [ | |
| { | |
| "ContainerPort": "<CONTAINER_PORT>" | |
| } |
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
| option_settings: | |
| aws:elb:listener:443: | |
| ListenerProtocol: HTTPS | |
| SSLCertificateId: arn:aws:acm:us-east-1:890777365147:certificate/5f63e9b9-12ed-44c5-b761-4019cf592421 | |
| InstancePort: 80 | |
| InstanceProtocol: HTTP | |
| aws:elb:listener:80: | |
| InstancePort: '80' | |
| InstanceProtocol: HTTP | |
| ListenerEnabled: '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
| import { create } from 'apisauce' | |
| import Store from '../utils/store' | |
| import { API_URL } from './constants' | |
| const headers = { | |
| Accept: 'application/json', | |
| 'Content-Type': 'application/json', | |
| } | |
| export const api = create({ |
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 React from 'react'; | |
| import { | |
| Image, | |
| Platform, | |
| ScrollView, | |
| StyleSheet, | |
| TouchableOpacity, | |
| ListView, | |
| View, | |
| PermissionsAndroid, |
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
| // | |
| //models | |
| // | |
| type Model struct { | |
| ID uint `json:"id" gorm:"primary_key"` | |
| CreatedAt time.Time `json:"-" sql:"DEFAULT:current_timestamp"` | |
| UpdatedAt time.Time `json:"-" sql:"DEFAULT:current_timestamp"` | |
| DeletedAt *time.Time `json:"-" settable:"false"` | |
| } |
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
| var KEY_CRIPTY = []byte("@E#%_323E5%DMG!(332GG()!") | |
| // encrypt string to base64 crypto using AES | |
| func encrypt(key []byte, text string) string { | |
| plaintext := []byte(text) | |
| block, err := aes.NewCipher(key) | |
| if err != nil { | |
| fmt.Println(err) | |
| } |
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
| func ModelToJson(model interface{}) string { | |
| j, err := json.Marshal(model) | |
| if err != nil { | |
| panic(fmt.Sprintf("Error %v encoding JSON for %v", err, model)) | |
| } | |
| jsonStr := string(j) | |
| v := reflect.Indirect(reflect.ValueOf(model)) | |
| ot := v.Type() | |
| t := ot |