Skip to content

Instantly share code, notes, and snippets.

View philippeauriach's full-sized avatar
🎣
Fishing (or cycling) 🚴🏻‍♂️

Philippe Auriach philippeauriach

🎣
Fishing (or cycling) 🚴🏻‍♂️
View GitHub Profile
@philippeauriach
philippeauriach / Romefile
Created September 30, 2020 13:42
Realm Swift configuration in Carthage Romefile
# I add trouble having a successful "Valid cache" using Rome and latest version of Realm.
# After (a lot) of trial and errors, here is the ocnfiguration that works (Realm is not rebuilt everytime anymore)
repositoryMap:
- realm-cocoa:
- name: Realm
platforms: [iOS]
- name: Realm
type: static
platforms: [iOS]
@philippeauriach
philippeauriach / MyApp.swift
Last active June 14, 2020 17:01
A simple helper to trigger apple Storekit review only for users who actually uses the app
// when the user actullay uses your app (eg create something, or consults something important)
StoreReviewHelper.incrementEventCount()
// when the use may have the time to review the app (will not always show the review prompt, only if the event count is matched and Apple decides to show it)
StoreReviewHelper.checkAndAskForReview()
@philippeauriach
philippeauriach / WrappedInputWithRef.tsx
Created May 13, 2020 08:06
React: Using a forwarded ref in a forwarded component
/*
Usecase : you want a generic component for a text input with a title,
you create a component accepting a title props, returning a TextView along a TextInput.
For ease of use, this new component uses React.forwardRef to allow passing a ref to the TextInput.
BUT, you want this generic component to handle the case "when I click the title I focus the input),
so you need to "intercept" the forward ref
*/
interface MyCustomInputProps {
@philippeauriach
philippeauriach / ImageTools.js
Created December 1, 2019 20:23
Client side image resizing
/* eslint-env browser */
const hasBlobConstructor =
typeof Blob !== 'undefined' &&
(function() {
try {
return Boolean(new Blob());
} catch (e) {
return false;
}
Verifying my Blockstack ID is secured with the address 17r3ggGyk8N3zggQDyhT48swvYkgm3mNnP https://explorer.blockstack.org/address/17r3ggGyk8N3zggQDyhT48swvYkgm3mNnP

Keybase proof

I hereby claim:

  • I am philippeauriach on github.
  • I am philippeauriach (https://keybase.io/philippeauriach) on keybase.
  • I have a public key ASBhtST5hRBehtb_YiCYrEY0eyUHHCFdD7_c1LvMZz_orQo

To claim this, I am signing this object:

@philippeauriach
philippeauriach / fish.js
Created December 4, 2015 14:24
Generate CRUD from sequelize models (missing validators, auth, etc... just for the idea)
'use strict';
module.exports = function(sequelize, DataTypes) {
var Fish = sequelize.define('Fish', {
scientificName: DataTypes.STRING,
bio: DataTypes.TEXT
}, {
classMethods: {
/*associate: function(models) {
// associations can be defined here
},*/