Skip to content

Instantly share code, notes, and snippets.

View Grohden's full-sized avatar
:shipit:
*tec tec tec noises*

Gabriel Rohden Grohden

:shipit:
*tec tec tec noises*
View GitHub Profile
@Grohden
Grohden / Areas.java
Last active September 27, 2019 16:58
example java
public class Areas {
static class Retangulo {
protected int largura;
protected int altura;
Retangulo(int largura, int altura) {
this.largura = largura;
this.altura = altura;
}
@Grohden
Grohden / android-dev-bindings.sh
Last active December 2, 2019 12:01
React native bindings for IDE (jetbrains) keyboard shortcuts
#!/usr/bin/env bash
set -e
# Use this script to bind a keyboard shortcut (I recommend alt+shift+number)
# tools > external tools
# Program: /bin/bash
# # Here is up to you, you can place it on the project or globally
# Arguments .$Projectpath$/scripts/android-dev-bindings.sh reload
# Working directory: $ProjectFileDir$
# Then save/apply/ok and go to keymap > external tools and assign your shortcuts
@Grohden
Grohden / AnimatedMock.js
Created January 30, 2020 22:30
Fixed file for react native AnimatedMock.js
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
@Grohden
Grohden / nh.graphql
Last active April 24, 2025 00:48
NHentai rest api (kinda not documented) consumed and mapped by graphql
directive @client on FIELD
type GalleryItemImage {
t: String!,
w: Int!,
h: Int
}
type GalleryItemTag {
count: Int!
id: ID
@Grohden
Grohden / detox-run-android.yml
Created March 19, 2020 16:37
Azure devops detox run tests for ios and android
trigger:
- none
pool:
vmImage: 'ubuntu-latest'
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
GRADLE_USER_HOME: $(Pipeline.Workspace)/.gradle
@Grohden
Grohden / Label.tsx
Last active April 9, 2020 21:44
Slider prototype for react native
/* eslint-disable no-magic-numbers */
import React from 'react'
import { StyleSheet, Text, View, ViewStyle } from 'react-native'
import { BaseColors } from '@constants/colors'
import fonts from '@constants/fonts'
type Props = {
style: ViewStyle
}
// calls always the last
export const debounce = (time: number) => {
let timeout: ReturnType<typeof setTimeout> | null = null
return (fn: () => void) => {
if(timeout !== null) {
clearTimeout(timeout)
timeout = null
}
@Grohden
Grohden / home.dart
Created May 23, 2020 03:07
Prototype for home screen decentralisation of routes 'upper' widgets
class _HomeItem {
_HomeItem({
@required this.appbar,
@required this.body
});
final PreferredSizeWidget appbar;
final Widget body;
}
@Grohden
Grohden / flambda.dart
Last active July 2, 2020 13:39
Pain and suffering by forcing ramda into everything (in this case, dart)
library flambda;
typedef Predicate<T> = bool Function(T);
class Case<T, R> {
Case(this.predicate, this.whenTrue);
factory Case.otherwise(R Function(T) whenTrue) {
return Case((T) => true, whenTrue);
@Grohden
Grohden / CurrencyInput.tsx
Last active June 18, 2020 11:53
SIMPLE react native currency input for brazilian currency
/* eslint-disable @typescript-eslint/no-magic-numbers */
import { useRefCallback } from '@hooks/useRefCallback'
import React from 'react'
import { StyleProp, ViewStyle } from 'react-native'
import { TextInput } from 'react-native-paper'
type Props = {
label: string
value: number
onChangeValue: (value: number) => void