Skip to content

Instantly share code, notes, and snippets.

View miguelespinoza's full-sized avatar
💻
Focusing

Miguel Espinoza miguelespinoza

💻
Focusing
View GitHub Profile
@mairh
mairh / Redux-Form-Semantic-UI-React
Last active August 12, 2021 23:03
Semantic-UI-React form validation using redux-form example
// semantic-ui-form.js
import React from 'react';
import PropTypes from 'prop-types';
import { Form, Input } from 'semantic-ui-react';
export default function semanticFormField ({ input, type, label, placeholder, meta: { touched, error, warning }, as: As = Input, ...props }) {
function handleChange (e, { value }) {
return input.onChange(value);
}
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active April 11, 2024 15:02
React Native Bridging Cheatsheet
@passsy
passsy / KIntent.kt
Last active March 28, 2023 06:51
Kotlin extension functions to start a generic Activity
package com.pascalwelsch.extensions
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
/**
* Extensions for simpler launching of Activities
@richardgill
richardgill / normalizeStyle.js
Created December 2, 2016 16:31
Makes React Native components look more consistent on different device sizes. The base size is an iPhone 6.
import _ from 'lodash'
import { Dimensions, PixelRatio } from 'react-native'
import { platformIsIos } from 'expresso-common/common/platform'
const { height } = Dimensions.get('window')
const iphone6Height = 667
const pixelRatio = PixelRatio.get()
const fieldsToNormalize = [
'fontSize',
'lineHeight',
@jeffdgr8
jeffdgr8 / TimePickerDialogFixedNougatSpinner.java
Last active February 14, 2023 13:15
TimePickerDialog with fixed android:timePickerMode spinner in Nougat
package my.packagename;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.TimePicker;
import java.lang.reflect.Constructor;
@SalahAdDin
SalahAdDin / Steps.md
Last active May 29, 2022 06:11
Instlling React-Native Android Environment in ArchLinux

First step: Install Android SDK

  1. yaourt -S android-sdk android-sdk-platform-tools android-sdk-build-tools
    Note: Maybe you'll have problems with the lasta package: ncurses5-compat-libs. In order to avoid this problem you have to use this command: gpg --recv-keys F7E48EDB. You can find clarification here.
  2. yaourt -S genymotion
    Note: You'll need install virtual-box and his modules, yaourt will make for you but you need choos between ArchLinux host modules or DKMS host modules.
  3. Enter in super user mode with su - and then do echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf
    Note: You need do this with super user because need super user permissions and with sudo, for us at least, doesn't work.
  4. sudo modprobe vboxdrv vboxnetadp vboxnetflt
    Activate for current session.
  5. sudo chmod -R 777 /opt/android-sdk
@corbt
corbt / CheckConnectionActivity.java
Created September 18, 2015 16:49
React Native sample activity
package com.your.app;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import com.facebook.react.LifecycleState;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactRootView;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
@nbarraille
nbarraille / OrientationChangeAction.java
Last active January 30, 2023 00:04
An Espresso ViewAction that changes the orientation of the screen
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 - Nathan Barraille
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@dblandin
dblandin / activate_tab.applescript
Last active September 29, 2023 16:26
AppleScript to grab a list of tab titles from Google Chrome.
# Activate tab
# $ osascript activate_tab.applescript 1, 2
on run argv
set window_index to item 1 in argv
set target_index to item 2 in argv
tell application "Google Chrome" to set active tab index of first window to target_index
tell application "Google Chrome" to activate
end run