Skip to content

Instantly share code, notes, and snippets.

View flexbox's full-sized avatar

David Leuliette flexbox

View GitHub Profile
@flexbox
flexbox / bump-version.js
Last active December 15, 2023 08:51
numb version React Native expo usage in package.json `"release": "node bin/bump-app-version.js && bin/release",`
/* eslint-disable prefer-destructuring */
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require("fs");
// Read the contents of the app.config.ts file
fs.readFile("app.config.ts", "utf8", (err, data) => {
if (err) {
throw err;
}
// Copy paste this script on your console
var disabled = false;
var r = confirm('Start the Autolike on this page?');
var min_time_to_decide = 300;
var max_additional_time_to_decide = 1000;
var time_to_decide = function() {
additional_time_to_decide = Math.floor(Math.random() * max_additional_time_to_decide);
return min_time_to_decide + additional_time_to_decide;
id title
nb-icons
NativeBase Icons

NativeBase Icons was designed to make the integration of icons in NativeBase projects easier. It is a unified library that can export icons and fonts for all native and web platforms.

Built With

  • react-native-vector-icons
@flexbox
flexbox / test.md
Last active October 25, 2020 13:39

🤸‍♀️ Exercise 1

  • Create a Stack Navigator in src/exercice/02/PublicNavigator.tsx that shows the LoginScreen and the TermsScreen. You can read the official documentation https://reactnavigation.org/docs/stack-navigator/

  • Use LOGIN_SCREEN and TOC_SCREEN as route names to maintain consistency when navigating

  • Update the entry point of your application. Wrap your PublicStack with NavigationContainer using the Stack Navigator from src/final/02/PublicNavigator.tsx.

Hint: If you are lost you can debug the changes on the NavigationContainer with onStateChange={state => console.log('New state is', state)}

@flexbox
flexbox / index.js
Created March 16, 2020 16:25
airplane-sorting-algorithm.js
function solution(N, S) {
const occupied = S.split(' ')
let available = 0
console.log("solution -> available", available)
for (let index = 0; index < N; index++) {
if (
occupied[index] === `${index + 1}A` ||
occupied[index] === `${index + 1}B` ||
@flexbox
flexbox / 1-api.js
Last active January 30, 2020 15:57
Async / await cheatsheet
async customerUpdate(fields) {
try {
const { status, data } = await this.$axios…
return { status, data }
} catch (e) {
throw new Error(e)
}
}
@flexbox
flexbox / android.sh
Created July 2, 2018 13:54
React Native with expo SDK release script for android
#!/bin/sh
echo ''
echo '================'
echo 'Dependency check '
echo '================'
echo ''
yarn
echo ''
@flexbox
flexbox / cloudSettings
Last active September 10, 2019 15:40
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-09-10T15:40:17.871Z","extensionVersion":"v3.4.2"}
{
id: 1,
type: 'locked',
title: 'Inspired',
description_locked: '',
description_achieved: '',
congratulation: '',
illustration: 'inspired'
},
{
@flexbox
flexbox / read-my-PR.md
Last active March 20, 2019 23:18
Find a great pull request naming is hard. Hack your co-workers brain with theses messages

🇺🇸

  1. I turned a bug into a feature. And you will never forget how.
  2. No one had ever coded a function like that. No one.
  3. Never a small omission like that caused so much damage.
  4. The most silly bug in the world has been corrected — the smartest intelligent way.
  5. Do you love coding? That's probably why.
  6. Want to learn a new feature? here's how.
  7. This feature suddenly stopped working. What happened after is incredible
  8. It is possible to reduce a 50 lines function to 3 lines. here's how.