Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Cuong Lam thanhcuong1990

🏠
Working from home
Block or report user

Report or block thanhcuong1990

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 gist:c4ee6714c455e394799e21434620bca2
### Keybase proof
I hereby claim:
* I am thanhcuong1990 on github.
* I am thanhcuong1990 (https://keybase.io/thanhcuong1990) on keybase.
* I have a public key ASAnqYrwrHq2LX-FVSdCEY9OLnrfExGDdrm7WRMlvvMudQo
To claim this, I am signing this object:
@thanhcuong1990
thanhcuong1990 / App.jsx
Created Aug 22, 2018 — forked from ilya-uryupov/App.jsx
React-Native copy-paste'able multiline TextInput inside ViewPagerAndroid
View App.jsx
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react'
import { StyleSheet, Text, TextInput, View, ViewPagerAndroid } from 'react-native'
const rnVersion = '0.52.0'
@thanhcuong1990
thanhcuong1990 / learning.md
Created Jun 25, 2018 — forked from sibelius/learning.md
Learning Path React Native
View learning.md

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation

View react-native-router-flux-android-back-button.js
import { BackAndroid } from 'react-native';
import {Reducer} from 'react-native-router-flux';
backButtonPressedOnceToExit = false;
let currentSceneName = null;
const reducerCreate = params=>{
const defaultReducer = Reducer(params);
return (state, action)=>{
console.info("reducerCreate.{state,action}", state, action);
View posts_controller(2).rb
# /app/controllers/posts_controller.rb
def index
@posts = Post.where(:user_id => current_user.id).
order('created_at desc').
limit(10)
@trending = Topic.where('started_trending > ?', 1.day.ago).
order('mentions desc').
limit(7)
# ...
@thanhcuong1990
thanhcuong1990 / install-comodo-ssl-cert-for-nginx.rst
Created Nov 20, 2015 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@thanhcuong1990
thanhcuong1990 / Badge.swift
Created Nov 14, 2015 — forked from yonat/Badge.swift
Rounded UILabel and UIButton, Badged UIBarButtonItem
View Badge.swift
//
// Badge.swift
// Extensions for Rounded UILabel and UIButton, Badged UIBarButtonItem.
//
// Created by Yonat Sharon on 06.04.2015.
// Copyright (c) 2015 Yonat Sharon. All rights reserved.
//
import UIKit
@thanhcuong1990
thanhcuong1990 / 00.howto_install_phantomjs.md
Created Sep 24, 2015 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu
View 00.howto_install_phantomjs.md

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@thanhcuong1990
thanhcuong1990 / deploy.rb
Created Sep 24, 2015 — forked from stas/deploy.rb
Mina Deploy Task (Rails + Puma + Delay Job + rbenv)
View deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
View NSFileManager+DoNotBackup.h
@interface NSFileManager (DoNotBackup)
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;
@end
You can’t perform that action at this time.