Skip to content

Instantly share code, notes, and snippets.

View lovubuntu's full-sized avatar
🎯
Focusing

Prabu K lovubuntu

🎯
Focusing
  • https://www.quintype.com
  • Chennai
View GitHub Profile
@lovubuntu
lovubuntu / psql hba conf
Created April 10, 2017 10:36
find postgres hba file
psql -t -P format=unaligned -c 'show hba_file';
brew install go
brew install docker
brew install docker-machine
docker-machine create --driver virtualbox default
eval $(docker-machine env default)
docker build . -t dev/assessment-service
docker-machine ls
docker run -it -p 9000:9000 dev/assessment-service
docker-machine ip default
@lovubuntu
lovubuntu / gist:ce59ec2530f366f178791af65aca7e78
Created August 3, 2017 12:41
Debug voice activated app from GoogleNow
Yes, the app must be published to the Play Store in order for the feature to work.
One way to help debug your end is to trigger the intent via adb,
for example: adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION -e query leela,palace,chennai com.tripadvisor.tripadvisor
@lovubuntu
lovubuntu / gist:a5c711a72a26ba6468ef0e89f7a2a5f9
Created August 23, 2017 12:47
colorize and pretty print json in terminal
**Install Pygments**
`pip install pygments`
** Create the following function in bashrc **
```
function jcurl() {
curl "$@" | json | pygmentize -l json
}
```
@lovubuntu
lovubuntu / Deserializer.kt
Created November 24, 2017 08:54
Simple Deserializer for fuel
import com.github.kittinunf.fuel.core.ResponseDeserializable
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.JsonDeserializer
import com.google.gson.reflect.TypeToken
class Block() {
class Deserializer : ResponseDeserializable<Block> {
override fun deserialize(reader: Reader) = Gson().fromJson(reader, Block::class.java)
@lovubuntu
lovubuntu / Sha256.kt
Created November 24, 2017 15:58
function to generate Sha-256 in Kotlin
Class Hasher {
fun hash(): String {
val bytes = this.toString().toByteArray()
val md = MessageDigest.getInstance("SHA-256")
val digest = md.digest(bytes)
return digest.fold("", { str, it -> str + "%02x".format(it) })
}
}
@lovubuntu
lovubuntu / BlockService.Kt
Created November 24, 2017 16:01
Make network calls using Fuel library
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.kittinunf.fuel.httpGet
import com.github.kittinunf.fuel.httpPost
import tech.ajira.kitCoin.models.Block
object BlockService {
fun broadcastNewBlock(nodeAddresses: Set<String>, newBlock: Block) {
val jsonString = ObjectMapper().writeValueAsString(newBlock)
nodeAddresses.forEach { nodeAddress ->

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@lovubuntu
lovubuntu / introrx.md
Created February 2, 2018 07:31 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing