Skip to content

Instantly share code, notes, and snippets.

View EduVencovsky's full-sized avatar
🎯
Focusing

Eduardo Vencovsky EduVencovsky

🎯
Focusing
View GitHub Profile
@EduVencovsky
EduVencovsky / index.html
Created October 22, 2019 18:52
CSS Scale Transition
<button id="open">open</button>
<div class="box scale">
<h1>
hey
</h1>
</div>
@EduVencovsky
EduVencovsky / useNavigationFocusChanged.js
Last active November 8, 2019 01:08
React Hooks to listen to navigation didFocus event
import { useState, useEffect, useRef } from 'react'
export const useNavigationFocusChanged = (navigation, event) => {
const [focus, setFocus] = useState(false)
const listener = useRef(null)
useEffect(() => {
const changeFocus = () => {
setFocus(prev => !prev)
}
listener.current = navigation.addListener(event, changeFocus)
@EduVencovsky
EduVencovsky / RotateView.js
Created November 13, 2019 01:15
Component for creating a rotating View in React Native
import React, { useEffect, useState } from 'react'
import PropTypes from 'prop-types'
import { Animated, Easing } from 'react-native'
const RotateView = ({ rotate, degree, initialDegree, duration, children, ...otherProps }) => {
const [rotateValue] = useState(new Animated.Value(0))
useEffect(() => {
const toValue = rotate ? 1 : 0
@EduVencovsky
EduVencovsky / CustomAttributeHelper.cs
Last active June 17, 2021 08:01
Helper to get custom attributes from a property with Blazor
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
namespace ADD_YOUR_NAME_SPACE_HERE
{
public static class CustomAttributeHelper
{
public static MemberInfo GetExpressionMember<T>(Expression<Func<T>> accessor)
@EduVencovsky
EduVencovsky / ga.ipynb
Last active April 19, 2020 19:47
Use um AG para encontrar o ponto máximo da função: f(x) = x^2 sendo 0 <= x <= 31 e x é inteiro
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EduVencovsky
EduVencovsky / TodoList.tsx
Created August 1, 2020 14:11
Todo List com React Hooks, Typescript e Material-UI
import React, { useState } from 'react'
import { TextField, IconButton } from '@material-ui/core'
import AddIcon from '@material-ui/icons/Add'
import DeleteIcon from '@material-ui/icons/Delete'
interface TodoItem {
id: number
value: string
}
@EduVencovsky
EduVencovsky / capcut-uppercase-captions.js
Last active October 5, 2025 16:45
Makes CapCut captions uppercase correctly even when there's accents
upperCaseCaptions = () => {
const items = document.querySelectorAll('.subtitle-list-item textarea')
const reactProp = Object.keys(items[0]).find(x => x.startsWith('__reactProps'))
items.forEach(item => {
const upperText = item.textContent.toUpperCase()
item[reactProp].onChange({target: {value: upperText}})
})
}
upperCaseCaptions()