Skip to content

Instantly share code, notes, and snippets.

View yathu's full-sized avatar
:octocat:
Learning every day ❤️...

yathavan yathu

:octocat:
Learning every day ❤️...
View GitHub Profile

Fix React Native 'atomic_notify_one' is unavailable issue by Xcode12.5

Update in {project-name}/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h

  1. atomic_notify_one(state); to folly::atomic_notify_one(state);

  2. auto result = atomic_wait_until(&state, previous | data, deadline); to auto result = folly::atomic_wait_until(&state, previous | data, deadline);

@yathu
yathu / main.dart
Created May 22, 2021 14:10
Flutter Fixed left navigation
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
/// This is the main application widget.
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Flutter Code Sample';
@yathu
yathu / utils.dart
Created May 6, 2021 18:29 — forked from nicky-song/utils.dart
Flutter: Create MaterialColor from a hex color
MaterialColor createMaterialColor(Color color) {
List strengths = <double>[.05];
Map swatch = <int, Color>{};
final int r = color.red, g = color.green, b = color.blue;
for (int i = 1; i < 10; i++) {
strengths.add(0.1 * i);
}
strengths.forEach((strength) {
final double ds = 0.5 - strength;
@yathu
yathu / BottomSheet.jsx
Created March 17, 2021 05:33 — forked from vforvasile/BottomSheet.jsx
react-native-reanimated-bottom-sheet with backdrop close effect onPress
import * as React from 'react';
import {
StyleSheet,
Text,
View,
TouchableOpacity,
Animated,
Dimensions,
Button,
} from 'react-native';
npx react-native run-ios --simulator="iPhone 8"
npx react-native run-ios --simulator="iPhone 8 Plus"
npx react-native run-ios --simulator="iPhone 11"
npx react-native run-ios --simulator="iPhone 11 Pro"
npx react-native run-ios --simulator="iPhone 11 Pro Max"
npx react-native run-ios --simulator="iPhone SE (2nd generation)"
npx react-native run-ios --simulator="iPhone 12 mini"
npx react-native run-ios --simulator="iPhone 12"
npx react-native run-ios --simulator="iPhone 12 Pro"

npx react-native run-ios --simulator="iPhone 12 Pro Max"

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@yathu
yathu / Install Composer using MAMP's PHP.md
Created July 29, 2020 17:20 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@yathu
yathu / main.dart
Last active July 26, 2020 07:48
Flutter Provider counter example
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
@yathu
yathu / main.dart
Last active May 18, 2020 05:34
How to Give BorderRadius to SliverList
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@yathu
yathu / gulpfile.js
Last active March 10, 2022 11:05
Gulp 4 sample gulpfile.js with Jekyll and Browser-sync
const { src, dest, watch, series, parallel } = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
const rename = require('gulp-rename');
const sourcemaps = require('gulp-sourcemaps');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');