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 / 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 / android-Appfile
Last active February 2, 2024 02:54
Release Flutter fastlane + azure pipelines (based on chimon2000/03b0fb1fa2f96c5933e3c9cb1ba59bc7 gist)
package_name("com.foo.bar")
@Grohden
Grohden / index.ts
Last active January 21, 2024 00:16
My "port" fo the Vibrant lib for react native
import VibrantCore from '@vibrant/core';
import { pipeline } from './pipeline.ts';
import { ReactNativeImage } from './react-native-image.ts';
export const Vibrant = VibrantCore;
// Don't forget to add this to your app root:
// useEffect(() => {
@Grohden
Grohden / format-to-atex.js
Last active March 25, 2023 18:45
Transform a tab (?) format into an AlphaTex (for AlphaTab)
// this heavily uses ramda
// this was done quickly to just make it work, its variale names essentialy do not have correct names
// this does not generate duration information
// you can just past it in ramda and it will run
// https://ramdajs.com/repl
// take the result and feed it into the alphaTab
@Grohden
Grohden / BundleEnumExtension.kt
Created August 23, 2018 03:58
Android Bundle enum support using kotlin extension methods
import android.os.Bundle
// Dunno if there's a better way to extend both bundle and intents, but
// you probably can extend intents in the same way
fun Bundle.putEnum(key:String, enum: Enum<*>){
putString(key, enum.name)
}
inline fun <reified T: Enum<T>> Bundle.getEnum(key:String): T {
@Grohden
Grohden / AutoHeightRBSheet.tsx
Last active January 9, 2023 09:56
React native raw bottom sheet with auto height calcs
// This is basically a copy of
// https://github.com/nysamnang/react-native-raw-bottom-sheet
// but using only translate animations instead of height
import React, {
forwardRef, ReactNode,
RefForwardingComponent,
useImperativeHandle,
useState
} from 'react'
module Prelude
class Functor
def initialize(value)
@value = value
end
# All implementers must satisfy
# (a -> b) -> f a -> f b
def fmap
self.class.new(yield @value)
@Grohden
Grohden / lookahead.md
Created June 23, 2022 20:43
GQL ruby gem lookahead extra

The [lookahead][1] feature is exposed through an [extra][2]:

field :organizations, [Organization], extras: [:lookahead]

By declaring the lookahead extra we can use it to know which fields the client is asking for (through selects?):

def organizations(lookahead:)
@Grohden
Grohden / main.dart
Last active June 3, 2022 18:21
Dart currying
void main() {
final sum2 = curry2((int a, int b) => a + b);
final sum3 = curry3((int a, int b, int c) => a + b + c);
print(sum2(1));
print(sum2(1)(2));
print(sum3(1));
print(sum3(1)(2));
print(sum3(1)(2)(3));
@Grohden
Grohden / ViewExtensions.kt
Last active May 13, 2022 09:08
My view extensions
package why.android.dont.have.those
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.view.View
import android.view.ViewGroup
import androidx.annotation.ColorRes
import androidx.core.content.ContextCompat