Skip to content

Instantly share code, notes, and snippets.

View brunoksato's full-sized avatar
Focusing

Bruno Sato brunoksato

Focusing
View GitHub Profile
@brunoksato
brunoksato / Dockerrun.aws.json.template
Created September 16, 2018 18:39
Dockerrun.aws.json.template
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.<AWS_REGION>.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "<CONTAINER_PORT>"
}
@brunoksato
brunoksato / loadbalancer-terminatehttps.config
Last active September 16, 2018 19:12
loadbalancer-terminatehttps-staging.config
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'
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({
@brunoksato
brunoksato / scan.js
Created September 15, 2017 19:22
Scandit barcode
import React from 'react';
import {
Image,
Platform,
ScrollView,
StyleSheet,
TouchableOpacity,
ListView,
View,
PermissionsAndroid,
@brunoksato
brunoksato / generics.go
Last active April 17, 2017 18:27
Generics.go
//
//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"`
}
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)
}
@brunoksato
brunoksato / json.go
Created June 10, 2016 11:52
helpers json
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
import path from 'path';
exports.register = (plugin, options, next) => {
plugin.route({
method: 'GET',
path: '/docs/{param*}',
handler: {
directory: {
path: path.join(__dirname, '../../docs'),
listing: true,
@brunoksato
brunoksato / factory.js
Last active February 4, 2016 19:44
factory.js
(function() {
'use strict';
angular
.module('pub.posts.service', [])
.factory('PostsService', PostsService);
/** @ngInject */
function PostsService($http, $q, API) {
@brunoksato
brunoksato / codigo completo
Created January 15, 2016 18:25
Modal tela cheia
//html
<!--Start of Modal -->
<div class="modaal">
<input id="modaal__trigger" type="checkbox" />
<label class="{{className}}" for="modaal__trigger">{{buttonText}}</label>
<div class="modaal__overlay" role="dialog" aria-labelledby="modaal__title" aria-describedby="modaal_desc">
<div class="modaal__wrap">
<label for="modaal__trigger">&#10006;</label>
<ng-transclude></ng-transclude>
</div>