1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
private fun getLocalIpAddress(): String? { | |
try { | |
val wifiManager: WifiManager = context?.getSystemService(WIFI_SERVICE) as WifiManager | |
return ipToString(wifiManager.connectionInfo.ipAddress) | |
} catch (ex: Exception) { | |
Log.e("IP Address", ex.toString()) | |
} |
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
<template> | |
<button @click="emitEvent">EVENT</button> | |
</template> | |
<script> | |
import { EV } from './events' | |
export default { | |
methods: { | |
emitEvent() { |
# download speedtest python script | |
# wget https://raw.githubusercontent.com/rsvp/speedtest-linux/master/speedtest | |
# wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py | |
while true; do ./speedtest --log; sleep 900; done |