Travis Tran

Travis Tran

Keep Doing Better

WordPress Diagrams

Template Hierarchy of WikiMedia:

Codex Template Hierarchy

 

An extended one:

Chip Bennet Template Hierarchy

Text Flow Diagram:

wordpress-text-flow-vs-markdown

Program Flow:

Wordpress 3.0 Program Flow

Query Function Diagram:

WP_Query

Core load diagram:

 

 

Protect your sensitive information on website from spam

We hate spam so much that we wrote the following script to help you avoid getting spam in the first place. This javascript program converts normal e-mail addresses into code that most, if not all spam-bots (robots that run programs that harvest e-mail addresses) were not decoding in 2005. If you use the generated codes you are likely to get a great deal less spam than if you put an e-mail address in a web-page in clear text (that is, not encoded). The javascript program to obfuscate an e-mail address is simple to use.

Continue reading

25+ JavaScript Shorthand Coding Techniques

This really is a must read for any JavaScript developer. I have written this guide to shorthand JavaScript coding techniques that I have picked up over the years. To help you understand what is going on, I have included the longhand versions to give some coding perspective.

Continue reading

Định giá Startup chưa doanh thu

Startup chưa doanh thu làm gì có yếu nào đo lường hay dự đoán được xu hướng (xu hướng chính là yếu tố quyết định giá trị)? Không dòng tiền, không chi phí lợi nhuận, không tính được chi phí acquire khách hàng, không tính được lợi nhuận trên khách hàng/giao dịch/sản phẩm…Nó giống như 1 chấm trên đồ thị mà không biết hàm số, nó có thể đi tút lên, nhào xuống, xoay tròn hay băng ngang mãi mãi.
Nếu không dự đoán được xu hướng chấm tròn trong đồ thị, làm sao có thể dự đoán giá trị tương lai của Startup?

Continue reading

5 phương pháp định giá doanh nghiệp thường dùng

Nhắc đến những khái niệm mơ hồ trong giới đầu tư, không thể không kể đến khái niệm “giá trị doanh nghiệp”. Làm sao để gán giá trị cho doanh nghiệp khi mà nó là tập hợp của muôn vàn thành cấu hữu hình và vô hình? Dẫu cực kỳ khó để đưa ra một mức định giá chính xác, và thực tế là chẳng ai biết thế nào mới là chính xác, nhưng việc xác định được giá trị công ty là bước then chốt trong quá trình đầu tư. Các bên dựa vào giá trị công ty và lượng tiền đầu tư để xác định cổ phần của mình trong công ty và mức định giá mới; rồi lại dựa vào cổ phần để xác định những thứ quan trọng khác như mức cổ tức, quyền biểu quyết, …

Continue reading

React Native – Setting up the environment

Integrated Development Environments

First things first. In order to get create React Native applications you are going to need the right IDEs.

Xcode for iOS

Android Studio for Android

React Native with IntelliJ IDEA

Configuring Android Emulator:

touch ~/.zshenv
open ~/.zshenv

Then in paste the following at the bottom of your newly opened file:

export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

(macOS) Type source ~/.zshenv to reload .zshenv and update any functions you add.

source ~/.zshenv

For a list of AVD names, enter the following command:

emulator -list-avds

Here’s the basic command-line syntax for starting a virtual device from a terminal prompt:

emulator @avd_name [ {-option [value]} … ]

# Example
emulator -avd Nexus_5X_API_23 -netdelay none -netspeed full

You can create an alias command to start emulator easier. In macOS, add the following lines at the bottom of .zshrc :

touch ~/.zshrc
open ~/.zshrc
alias run-android-emulator='emulator -avd Nexus_6_API_29 -netdelay none -netspeed full'

Reload and run:

source ~/.zshrc

To emulate the iOS platform, you need to install the ios-sim command-line tool globally. You can do it through the Node Package Manager (npm), see npm and Yarn, or by running the sudo npm install ios-sim -g command, depending on your operating system.

sudo npm install ios-sim -g

In the Arguments field, type the arguments to be passed to React Native, for example, specify the simulator type through the ‑‑simulator flag: ‑‑simulator="iPhone 4s".

https://www.jetbrains.com/help/idea/react-native.html#ws_react_native_run_and_debug

Install Windows 10 from a USB Flash Drive

I’m writing this because I can, for some reason, never remember how to use Diskpart. And who uses DVD’s anymore? Download the Windows 10 preview ISO from here: http://windows.microsoft.com/en-us/windows/preview

Insert a usb drive at least 4gb in size

Open a command prompt as administrator

Hit Windows Key, type cmd and hit Ctrl+Shift+Enter. This will force it to open as admin.

Run diskpart

This will open and run the Diskpart command line utility, which allows you to manage disks, partitions and volumes.

C:\Windows\system32> diskpart

Run list disk

This will list all disks on your system. You’ll see the something similar to this:

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          238 GB      0 B
  Disk 1    Online          465 GB      0 B
  Disk 2    Online           29 GB      0 B

Select your flash drive by running select disk #

Find the item that corresponds with your flash drive and select the disk. In the example above, my flash drive is disk 2 so I’ll run:

DISKPART> select disk 2

Disk 2 is now the selected disk.

Run clean

WARNING: This deletes all data on your drive

The clean command marks all data on the drive as deleted and therefore removes all partitions and volumes. Make sure you want to do this! If you are sure, run:

DISKPART> clean

Create a partition

 DISKPART> create partition primary

Select the new partition

Since we know there is only one partition, we can just run this:

DISKPART> select partition 1

Without checking the partition number. If you’re really curious, run list partition to check.

Format the partition

To format it, we’ll use the NTFS file system and run a quick format:

DISKPART> format fs=ntfs quick

Set the current partition as Active

Run:

DISKPART> active

Exit diskpart

Run exit. This will exit diskpart, but leave the command window open.

Mount your ISO

Use Virtual CloneDrive or similar.

Navigate to the mounted image and install a bootsector

My ISO is mounted as G:\, so I’ll navigate to G:\boot and run:

C:Windowssystem32> G:
G:\> cd boot
G:\boot> bootsect.exe /nt60 E:

Where E:\ in this case is my flash drive’s letter.

Copy the entire contents of the ISO to your flash drive

You can either do this from Windows using Ctrl+C+Ctrl+V, or from the command line using xcopy.

G:\> xcopy g:\*.* e:\ /E /H /F

/E copies all subfolders, /H copies all hidden files and /F displays all source and destination file names as it’s copying.

Once that’s done, go and install Windows!

Source: https://davidzych.com/install-windows-10-from-a-usb-flash-drive/

X
Glad to have you at travistran.me
Welcome to TravisBot
wpChatIcon