Skip to content

Instantly share code, notes, and snippets.

View ethan605's full-sized avatar

Thanh Nguyen ethan605

View GitHub Profile
@ethan605
ethan605 / GenyMotion with Google Play.md
Last active October 9, 2017 01:23 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services for ARM

Note: Easier way is the X86 way, described here

  1. Download the following ZIPs:

Note: Genymotion must be set to use it's own ADB (Settings -> ADB -> Use Genymotion Android tools)

  1. Open your Genymotion VM and go to the Homescreen
@ethan605
ethan605 / RoutersMiddleware.js
Last active June 8, 2017 01:02
A middleware for `react-navigation` library to prevent duplicated navigates. Note that is is a hack/workaround that works but not an official solution for React Navigation.
/**
* A middleware to detect short-time action dispatches
* This will check all 'Navigation/' prefixed actions
* which are duplicated over a short duration (`DISPATCH_THROTTLE`)
* and prevent them to be reduced to make new states.
*/
import Singleton from 'singleton';
import _ from 'lodash';
@ethan605
ethan605 / .eslintrc
Last active January 18, 2018 08:58
ESLint config file following Airbnb Javascript Style Guide
{
"env": {
"browser": true,
"es6": true,
"jest": true,
"node": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
@ethan605
ethan605 / Vietnamese characters
Last active March 30, 2023 01:53
Vietnamese characters
AÀÁẢÃẠ
ĂẰẮẲẴẶ
ÂẦẤẨẪẬ
BC
EÈÉẺẼẸ
ÊỀẾỂỄỆ
GH
IÌÍỈĨỊ
KLMN
@ethan605
ethan605 / LICENSE
Last active January 26, 2017 18:01
react-native-router-flux custom panHandlers
MIT License
Copyright (c) 2016 Ethan Nguyen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ethan605
ethan605 / ssh_config
Created September 9, 2016 02:36
SSH config for multiple private keys
Host myshortname realname.example.com
HostName realname.example.com
IdentityFile ~/.ssh/realname_rsa # private key for realname
User remoteusername
Host myother realname2.example.org
HostName realname2.example.org
IdentityFile ~/.ssh/realname2_rsa
User remoteusername
# Patch for pygments/formatters/img.py
# Define font to use
DEFAULT_FONT_NAME_NIX = 'Menlo'
class FontManager(object):
# ... Other methods
def _get_nix_font_path(self, name, style):
# Fix 'fc-list' command to explore exact font to use
# Nginx config
passenger_root /home/deployer/.rvm/gems/ruby-2.1.3/gems/passenger-4.0.53;
#passenger_ruby /usr/bin/ruby;
passenger_max_pool_size 70;
passenger_min_instances 1;
passenger_max_requests 20; # A workaround if apps are mem-leaking
passenger_pool_idle_time 300;
passenger_max_instances_per_app 30;
passenger_pre_start http://service.memo.edu.vn/;
@ethan605
ethan605 / system_admin_job_desc
Last active August 29, 2015 14:17
System admin Job descriptions
# Job descriptions
## 1. Mô tả công việc:
* Quản trị & bảo trì hàng ngày hệ thống servers sản phẩm trực tuyến phục vụ 100k người dùng
* Báo cáo hàng tuần các thông tin về hệ thống & người dùng
* Phát triển (mở rộng, nâng cấp) & quản lý hệ thống để phục vụ thêm nhiều người dùng
* Xử lý nóng khi có sự cố phát sinh
## 2. Yêu cầu Kỹ năng
* Sử dụng thành thạo hệ điều hành Linux (Ubuntu, Fedora, Debian, ...)
// For responding to the user accepting a newly-captured picture or movie
- (void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info {
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
[self dismissModalViewControllerAnimated:NO];
// Handle a movie capture
if (CFStringCompare ((__bridge_retained CFStringRef)mediaType, kUTTypeMovie, 0)