Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Tuan Nguyen Anh anhtuank7c

🎯
Focusing
Block or report user

Report or block anhtuank7c

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View smscode
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
@anhtuank7c
anhtuank7c / svg-css-inliner-color-hexer-gradient-defs-grouper-number-formatter.js Convert Illustrator SVG export into cross-platform CSS independent mode. CSS rule and style inlining, group gradients into a definitions tag, remove elements with display set to none, make colors hex. Works with react-native-web react-native-svg and svgs to give cross-platform web and native mobile rendering of any SVG produced in Illustrator.
View svg-css-inliner-color-hexer-gradient-defs-grouper-number-formatter.js
/*
Import https://raw.githubusercontent.com/MikeMcl/decimal.js/master/decimal.js first
Then run this.
Then put it into the SVG to JSX Online Converter http://svg-jsx.patmoody.com/
Then find (e.g. using WebStorm) all occurences of the regexp </?.
Select all matches (the first letter of every react tag) and toggle case / replace with upper case (to use cross-platform react components from the svgs library)
Finally, wrap in a pure function and make sure to import all needed components:
import React from "react";
@anhtuank7c
anhtuank7c / close.svg
Created Jun 13, 2017
svg file for react native
View close.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anhtuank7c
anhtuank7c / CrabstudioUtils.java
Created Jun 5, 2017
Hướng dẫn gọi function native từ js.
View CrabstudioUtils.java
package com.devjobs;
import android.app.Dialog;
import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
import android.provider.ContactsContract;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
@anhtuank7c
anhtuank7c / Animations
Last active Nov 7, 2017
How to use nativeDriver in React Native Animations
View Animations
useNativeDriver:
- docs: https://facebook.github.io/react-native/docs/animations.html#using-the-native-driver
- whitelist: https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/NativeAnimatedHelper.js#L147
- example:
https://github.com/facebook/react-native/issues/9864#issue-176486623
https://snack.expo.io/HJYvJKI3l
https://medium.com/xebia/linking-animations-to-scroll-position-in-react-native-5c55995f5a6e
@anhtuank7c
anhtuank7c / Podfile
Created May 31, 2017
Cài đặt react-native-maps
View Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'demo' do
# Fixes required for pod specs to work with rn 0.42
react_native_path = "../node_modules/react-native"
pod "Yoga", :path => "#{react_native_path}/ReactCommon/yoga"
pod "React", :path => react_native_path
@anhtuank7c
anhtuank7c / firebase_chat_data_structure
Last active Jun 26, 2017
A simple chat firebase data structure.
View firebase_chat_data_structure
{
"messages" : {
"-KgxvzeIQc30MLWT5zwX" : {
"-Kgxvzf58f8-GHJxvwWG" : {
"createdAt" : 1491392789639,
"text" : "A",
"user" : {
"_id" : "t8U329k7dEfyW0UYM38Kodoqzy22",
"avatar" : "https://scontent.xx.fbcdn.net/v/t1.0-1/p100x100/16426170_972992216166359_6914329574455833352_n.jpg?oh=0ff992858f7f4785b0a1d60a65118144&oe=59517ACD",
"name" : "Tuan Anh Nguyen"
@anhtuank7c
anhtuank7c / React Native: Animated - Code
Created Mar 15, 2017 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
View React Native: Animated - Code
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
View main.js
import React, { Component } from 'react';
import { View, Platform } from 'react-native';
import {
RTCPeerConnection,
RTCMediaStream,
RTCIceCandidate,
RTCSessionDescription,
RTCView,
MediaStreamTrack,
getUserMedia,
@anhtuank7c
anhtuank7c / gist:cf0aa44aafc89595fe69ee94948e4378
Created Jan 24, 2017
Cách fix lỗi range names trong excel
View gist:cf0aa44aafc89595fe69ee94948e4378
Bước 1: Mở file excel bị lỗi duplicate named
Bước 2: Nhấn Alt + F11 và Insert > Module rồi paste code sau vào
Option Explicit
Sub RemNamedRanges()
Dim nm As Name
On Error Resume Next
For Each nm In ActiveWorkbook.Names
nm.Delete
Next
You can’t perform that action at this time.