Skip to content

Instantly share code, notes, and snippets.

View antoinerousseau's full-sized avatar
:octocat:
git ftw

Antoine Rousseau antoinerousseau

:octocat:
git ftw
View GitHub Profile

Keybase proof

I hereby claim:

  • I am antoinerousseau on github.
  • I am antoine (https://keybase.io/antoine) on keybase.
  • I have a public key whose fingerprint is 1B5C 77C7 0297 8523 346F 4756 77DA 270D 4E75 46DE

To claim this, I am signing this object:

@antoinerousseau
antoinerousseau / SpeedDial.css
Created November 25, 2016 15:17
SpeedDial with material-ui
.cover {
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 1100; /* just above title bar */
transition: opacity 0.2s ease-in-out;
opacity: 1;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#5dc1b2+0,1fbcd2+100 */
@antoinerousseau
antoinerousseau / MaterialTextField.jsx
Created January 8, 2017 19:00
Material Design Text Field for React Native
import React, {Component, PropTypes} from 'react'
import {View, TextInput, Animated, StyleSheet, Platform} from 'react-native'
import colors from '../../common/constants/colors'
const getLabelSize = (focused) => focused ? 12 : 16
const getLabelPosition = (focused) => focused ? 16 : 37
const ANIMATION_DURATION = 200
export default class MaterialTextField extends Component {
{
"asset": {
"copyright": "(C)2018 PC-TEDDY-2",
"generator": "Maya2glTF V0.9.9 df3632e",
"version": "2.0"
},
"scenes": [
{
"nodes": [
0
@antoinerousseau
antoinerousseau / .eslintrc.js
Last active December 2, 2021 19:48
React Eslint config with TypeScript and Prettier
// yarn add typescript
// yarn add -D eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks @typescript-eslint/parser @typescript-eslint/eslint-plugin
// yarn add -D @types/react @types/react-dom
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["react", "react-hooks", "prettier"],
extends: ["plugin:react/recommended", "plugin:prettier/recommended"],
parserOptions: {
ecmaVersion: 2018,
/**
* This is an example React hook I wrote to demonstrate the use of an AbortController
* to avoid setting state on unmounted components
*
* Example use:
* const { data, loading, error } = useFetch<MyDataType>("https://reqres.in/api/users")
*/
import { useState, useEffect } from "react"
import HttpError from "standard-http-error"
import { PermissionsAndroid, Platform, Alert, Permission, PermissionStatus } from "react-native"
const permissions: Record<string, Permission> = {
// location: PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
camera: PermissionsAndroid.PERMISSIONS.CAMERA,
// read: PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,
write: PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
}
export const getPermissions = async (keys: string[]) => {
@antoinerousseau
antoinerousseau / RN fetch.md
Last active July 15, 2020 21:54
List of working and non working fetch requests in RN Android

List of working and non working fetch requests in RN Android

  • React Native version: 0.62.2
  • Affected platform: Android (iOS is working fine)
  • Affected stages: debug & release
  • Affected JS engines: jsc, v8 & Hermes
  • Used phones: Redmi Note
  • Tried to comment out initializeFlipper without success
  • Tried to set FLIPPER_VERSION=0.39.0 without success
  • The problem also happens in Postman on macOS with the "SSL certificate verification" option enabled, although the failing URLs don't show any SSL warning in Chrome browser
@antoinerousseau
antoinerousseau / bottom.html
Last active June 14, 2022 03:08
nginx config for custom file listing
<script>
var list = [];
document.querySelectorAll("a").forEach(function(tag) {
if (tag.innerText === "../" || tag.rel) {
return;
}
var url = tag.href.replace(location.href, "");
var file = decodeURIComponent(url);