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 / main.dart
Last active July 14, 2020 18:18
example of ignored side effects by tree shaking unused nodes in dart
String b() {
print("Hey, I'm a side effect, I'm gonna mess with your program!");
return "";
}
final a = b();
void main() {
@Grohden
Grohden / shrekd.dart
Created July 6, 2020 20:42
Shrek ascii art found somewhere on internet
// ⡴⠑⡄⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠸⡇⠀⠿⡀⠀⠀⠀⣀⡴⢿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠑⢄⣠⠾⠁⣀⣄⡈⠙⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⢀⡀⠁⠀⠀⠈⠙⠛⠂⠈⣿⣿⣿⣿⣿⠿⡿⢿⣆⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⢀⡾⣁⣀⠀⠴⠂⠙⣗⡀⠀⢻⣿⣿⠭⢤⣴⣦⣤⣹⠀⠀⠀⢀⢴⣶
// ⠀⠀⢀⣾⣿⣿⣿⣷⣮⣽⣾⣿⣥⣴⣿⣿⡿⢂⠔⢚⡿⢿⣿⣦⣴⣾⠁⠸⣼
// ⠀⢀⡞⠁⠙⠻⠿⠟⠉⠀⠛⢹⣿⣿⣿⣿⣿⣌⢤⣼⣿⣾⣿⡟⠉⠀⠀⠀⠀
// ⠀⣾⣷⣶⠇⠀⠀⣤⣄⣀⡀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀
// ⠀⠉⠈⠉⠀⠀⢦⡈⢻⣿⣿⣿⣶⣶⣶⣶⣤⣽⡹⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠉⠲⣽⡻⢿⣿⣿⣿⣿⣿⣿⣷⣜⣿⣿⣿⡇⠀⠀⠀⠀⠀
@Grohden
Grohden / main.dart
Last active July 1, 2020 20:47
Dart extension for DateTime sum/subtraction operations
extension CopyWithAdditional on DateTime {
DateTime copyWithAdditional({
int years,
int months = 0,
int days = 0,
int hours = 0,
int minutes = 0,
int seconds = 0,
int milliseconds = 0,
int microseconds = 0,
@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
@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 / 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;
}
// 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 / 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
}
@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 / 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