Skip to content

Instantly share code, notes, and snippets.

View carlossaraiva's full-sized avatar

Carlos Saraiva carlossaraiva

  • São Paulo, Brasil
View GitHub Profile

Keybase proof

I hereby claim:

  • I am carlossaraiva on github.
  • I am carlossaraiva (https://keybase.io/carlossaraiva) on keybase.
  • I have a public key whose fingerprint is AB50 4168 E935 5C9C 2C02 C04F 7F8D 902D B44B C613

To claim this, I am signing this object:

@carlossaraiva
carlossaraiva / machine.js
Last active March 12, 2021 08:14
Generated by XState Viz: https://xstate.js.org/viz
const paymentMachine = Machine({
id: "payment",
initial: "products",
context: {
items: 0,
paymentForm: null,
retries: 0,
},
states: {
products: {
@carlossaraiva
carlossaraiva / radial_menu.dart
Created October 16, 2020 20:12
radial_menu.dart
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math.dart' as math;
import 'dart:math';
import 'package:auto_route/auto_route.dart';
class RadialMenu extends StatefulWidget {
@override
_RadialMenuState createState() => _RadialMenuState();
}
(function () {
function t() {
var a = 0;
try {
a = r.performance.timing.navigationStart + Math.floor(r.performance.now())
} catch (b) {}
return 0 >= a || isNaN(a) ? (new Date).getTime() : a
}
function B(a, b) {
@carlossaraiva
carlossaraiva / intent-hoc.jsx
Created May 15, 2018 22:46
A hoc to render components dynamically.
import React from 'react'
import PropTypes from 'prop-types'
import Wrapper from './wrapper'
import { Definition, Translation, Help, Normal } from './intents-templates'
const withIntent = Component => {
const Balon = ({
intent = 'normal',
title,
@carlossaraiva
carlossaraiva / app.js
Last active March 27, 2018 18:10
native-base
import React, { Component } from 'react'
import { Root } from "native-base"
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { addNavigationHelpers } from 'react-navigation'
import RootNavigator from '@navigators/root-navigator'
class App extends Component {
static navigationOptions = {
angular.module('genesys')
.controller('storesCtrl', ['StoresService','$rootScope', '$scope', 'utils', 'config', '$compile', '$sessionStorage', 'uiGmapgoogle-maps', function(StoresService, $rootScope, $scope, $compile, utils, config, $sessionStorage) {
$scope.map = { center: { latitude: 45, longitude: -73 }, zoom: 8 };
$scope.dataTableOptions = {
serverSide: false,
//createdRow: (row, data, index) => $compile(angular.element(row))($scope),
Private Sub Codigo_Aluno_Enter()
Dim MyRec As DAO.Recordset
Dim myVar
Set db = CurrentDb
Set MyRec = db.OpenRecordset("SELECT * FROM Cadastro Where Codigo_Aluno = " & Chr$(39) & Codigo_Aluno.Text & Chr$(39))
If MyRec.RecordCount > 0 Then
Label5.Caption = MyRec.Fields("Nome")
CurrentDb.Execute ("INSERT INTO Entrada (Codigo_Aluno) VALUES (" + Codigo_Aluno.Text + ")")
End If
function moneyFormatConvert(value: string) {
var money = new RegExp(/^((?:\d{1,3}\,?)+)(\.\d{1,2})/).exec(value);
return money[1].replace(/,/g, ".") + money[2].replace(".", ",");
}
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If UCase(Sh.Name) = "SHEET1" Or UCase(Sh.Name) = "SHEET2" Then
If Not Application.Intersect(Target, Range(Target.Address)) Is Nothing Then
Application.EnableEvents = False
If UCase(Target.Parent.Name) = "SHEET1" And Target.Column = 1 Then
Sheets("Sheet2").Range(Target.Address) = Target
ElseIf UCase(Target.Parent.Name) = "SHEET2" And Target.Column = 1 Then
Sheets("Sheet1").Range(Target.Address) = Target
End If
Application.EnableEvents = True