Skip to content

Instantly share code, notes, and snippets.

View abdullahceylan's full-sized avatar
🎯
Focusing

Abdullah Musab Ceylan abdullahceylan

🎯
Focusing
View GitHub Profile
@abdullahceylan
abdullahceylan / expo-react-native-issues-solutions.md
Last active August 10, 2023 23:00
Expo - React Native issues and solutions

Problem 1

Invariant Violation: requireNativeComponent: "ViewManagerAdapter_ExpoLinearGradient" was not found in the UIManager.

This is because some of the packages (peer dependencies of 3rd parties) use a different version of expo-linear-gradient. You can solve this by adding the version you want to use in the resolutions section of package.json

  "resolutions": {
    "expo-linear-gradient": "~11.4.0"
  }
@abdullahceylan
abdullahceylan / howto.md
Last active August 27, 2022 00:55 — forked from miazga/howto.md
Expo + Android TV
// ==UserScript==
// @name Medium: remove location hash
// @namespace http://efcl.info/
// @description Remove location hash from medium
// @include https://medium.com/*#*
// @version 1
// @grant none
// ==/UserScript==
function removeLocationHash(){

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@abdullahceylan
abdullahceylan / unicode_slugify.js
Created November 22, 2019 20:44
Javascript Unicode Text Slugify
function slugify(str) {
str = str.replace(/^\s+|\s+$/g, "") // trim
str = str.toLowerCase()
// remove accents, swap ñ for n, etc
var from = "ıİşŞçÇüÜğĞöÖàáäâèéëêìíïîòóöôùúüûñç·/_,:;"
var to = "iissccuuggooaaaaeeeeiiiioooouuuunc------"
for (var i = 0, l = from.length; i < l; i++)
str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i))
@abdullahceylan
abdullahceylan / fix.md
Last active July 25, 2019 21:11
MacOS High Sierra: Build error - "#include nested too deeply" #881

Open terminal and execute:

mkdir /tmp/includes
brew doctor 2>&1 | grep "/usr/local/include" | awk '{$1=$1;print}' | xargs -I _ mv _ /tmp/includes

If you get a 'Permission denied' error:

@abdullahceylan
abdullahceylan / cloudSettings
Last active March 25, 2021 22:10
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-03-25T22:10:55.298Z","extensionVersion":"v3.4.3"}
@abdullahceylan
abdullahceylan / uk-postcode-validator.js
Created March 11, 2019 18:23
U.K. Postcode Validator
const postcodeRegex = /^[A-z]{1,2}[0-9Rr][0-9A-z]?[0-9][A-z]{2}$/;
const postcode = 'NG1 4UG';
const errors = {};
if (!postcode) {
errors.postcode = 'Please enter a postcode';
} else if (
!postcode
.replace(/\s/g, '')
.toUpperCase()
@abdullahceylan
abdullahceylan / balancePoint.js
Last active February 24, 2019 19:30
Balance points
function sum(a, b) {
return a + b;
}
var BalancePoint = function(input) {
if (!Array.isArray(input)) {
return -1;
}
var totalSum = input.reduce(sum, 0);
@abdullahceylan
abdullahceylan / create.bash
Created January 22, 2019 22:00
Create nested folders on Mac OS terminal
cat dirlist.txt | xargs mkdir -p