Skip to content

Instantly share code, notes, and snippets.

View anastely's full-sized avatar
:octocat:
Focusing

Anas Tely anastely

:octocat:
Focusing
View GitHub Profile
@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@heron2014
heron2014 / react-native-maps-enable-google-maps-instructions.md
Last active May 21, 2024 07:25
Visual instructions how to enable Google Maps on IOS using react-native-maps

Visual instructions how to enable Google Maps on IOS using react-native-maps

UPDATE: Following instructions are now a year old. I have recently managed to upgrade react-native-maps from 0.17 to the latest version 0.21 with react-native 0.51 - if you want to follow my instruction scroll down to the end this doc! Hope that will work for you too!

This is for my personal use, things might not be correctly explained here. For the official docs please check https://github.com/airbnb/react-native-maps

Steps from scratch:

1.react-native init GoogleMapPlayground

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@SergeyLipko
SergeyLipko / RN_flatList_example.js
Created May 29, 2017 18:21
Example of using RN FlatList component with pagination and pull-refreshing
import React from 'react';
import {
View,
Text,
FlatList,
StyleSheet
} from 'react-native';
import { ListItem } from 'react-native-elements';
class Users extends React.Component {
@virolea
virolea / upload.js
Last active June 11, 2024 06:48
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@hungvu193
hungvu193 / Bitrise.io Documents.md
Last active September 20, 2023 12:38
How to setup Bitrise.io to run a react native project

Set up a React Native app on Bitrise

Getting Started

Automating React Native apps on Bitrise? Sure thing! Let's see how! 🤖

  1. Log in to Bitrise and click +Add new app on your Dashboard!
  2. Connect your repository from your connected source code provider or add it manually. Connect repo
  3. Setup repository access (See DevCenter for detailed explanation!) Setup repo
  4. Validation setup: choose a branch for our scanner, this will help automation. How about a cuppa coffee while we are scanning your app?
@phuochau
phuochau / react-native-view-measurement.js
Last active May 16, 2023 15:09
Best way to measure layout of view in React Native (works in both iOS & Android)
import {
findNodeHandle
} from 'react-native'
this.childItem.measureLayout(findNodeHandle(this.containerWrapper), (x, y, width, height) => {
console.log('got measurement', x, y, width, height)
})
@diego3g
diego3g / settings.json
Last active June 26, 2024 18:28
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@wesleygrimes
wesleygrimes / arrays-in-javascript.js
Created August 30, 2019 13:48
JavaScript Arrays
const heroes = [
{ fullName: 'Spider-Man', heroId: 1 },
{ fullName: 'Iron Man', heroId: 2 },
];
const alterEgos = [
{ fullName: 'Peter Parker', heroId: 1 },
{ fullName: 'Tony Stark', heroId: 2 },
];
@kelset
kelset / build-time-improvements.md
Last active June 21, 2023 19:25
This is kind of a blogpost about my experience of diving deep to improve some timings for an iOS React Native app

Improving times for both iOS build and CI for a React Native app

Intro

Hello there.

So, if you are here you probably saw my previous tweet where I asked for tips & tricks on improving the timing on an iOS/React Native app build time.

What will follow was how I mixed those suggestions + some good old GoogleSearch-fu + me deep diving on this for ~2 days.