Skip to content

Instantly share code, notes, and snippets.

View dfeverx's full-sized avatar
🏠
Working from home

dfeverx dfeverx

🏠
Working from home
View GitHub Profile
/**
* Created by android tech point on 9/22/2017.
*/
fun Toast.createToast(context: Context, message:String, gravity:Int, duration:Int){
val inflater:LayoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
/*first parameter is the layout you made
second parameter is the root view in that xml
*/
val layout = inflater.inflate(R.layout.custom_toast_layout, (context as Activity).findViewById<ViewGroup>(R.id.custom_toast_container))
@dfeverx
dfeverx / custom-domain-localhost-xampp
Created February 5, 2019 16:14 — forked from oozman/custom-domain-localhost-xampp
How to add a custom domain name on your localhost using XAMPP. Codes are based on Windows, but Step 2 onwards are pretty much applicable on other operating system.
Step 1:
Go to: C:\Windows\System32\Drivers\etc\hosts
And add this to the bottom of the file:
=============
127.0.0.1 your.domain.com
=============
Step 2:
Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf