Skip to content

Instantly share code, notes, and snippets.

View anhtuank7c's full-sized avatar
🎯
Focusing

Tuan Nguyen anhtuank7c

🎯
Focusing
View GitHub Profile
@anhtuank7c
anhtuank7c / install_nginx_php7.sh
Last active March 8, 2017 09:45
Install nginx, openssl, google pagespeed, php7.0, mysql 5.7, phpmyadmin, cakephp 3.x on ubuntu 14.04 with default account "ubuntu". If your server don't have ubuntu account, please replace ubuntu by your account. Download this script to your server then "chmod +x install_nginx_php7.sh". Execute script by "./install_nginx_php7.sh"
#!/bin/bash
## Author: Anh Tuan Nguyen (anhtuank7c@hotmail.com)
## Created: 08/08/2016
## Install nginx, openssl, php7.0, mysql 5.7, phpmyadmin, cakephp 3.x
# update, upgrade to latest source
sudo apt-get update -y
sudo apt-get upgrade -y
# GOOGLE PAGE SPEED
composer require crabstudio/recaptcha
@anhtuank7c
anhtuank7c / React Native: Animated - Code
Created March 15, 2017 10:14 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* 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
@anhtuank7c
anhtuank7c / CrabstudioUtils.java
Created June 5, 2017 04:51
Hướng dẫn gọi function native từ js.
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 / close.svg
Created June 13, 2017 08:27
svg file for react native
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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.
/*
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 / firebase_chat_data_structure
Last active June 26, 2017 11:34
A simple chat firebase 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"
import React, { Component } from 'react';
import { View, Platform } from 'react-native';
import {
RTCPeerConnection,
RTCMediaStream,
RTCIceCandidate,
RTCSessionDescription,
RTCView,
MediaStreamTrack,
getUserMedia,
@anhtuank7c
anhtuank7c / smscode
Created October 21, 2017 14:51 — forked from asiatact/smscode
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
@anhtuank7c
anhtuank7c / index.ios.js
Created November 6, 2017 08:24 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';