Skip to content

Instantly share code, notes, and snippets.

the simple, the best

Nam Nguyen eneim

the simple, the best
View GitHub Profile
eneim /
Created Jul 9, 2022 — forked from tuanchauict/
Attach a stopwatch to Leetcode

This script attaches a stopwatch into the toolbar of Leetcode's problem page.

The feature is simple:

  • Start/Stop the stopwatch
  • Auto start after 2 mins remaining on the problem
  • Restore unstopped stopwatch for the next visit on the problem

Use this script with any browser extension allowing attaching JS to the page. (I use User JavaScript and CSS)

eneim / flowWithPrevious.kt
Created Jan 22, 2022
A Flow emits a pair of the original Flow's latest value and its previous value.
View flowWithPrevious.kt
* Given a Flow A, returns a [Flow] that emits a pair of the latest value emitted by A (as the
* second value of the pair), and the previous value emitted before (as the first value of the
* pair).
* Example
* ```
* val originalFlow = flowOf(1, 2, 3, 4)
* originalFlow.flowWithPrevious().collect { (l, r) ->
* println("Left: $l, Right: $r")
eneim /
Created Mar 2, 2021 — forked from lopspower/
Hexadecimal color code for transparency

Hexadecimal color code for transparency


How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

eneim /
Created May 26, 2019
ffmpeg script to encode video for Twitter
ffmpeg -i 'input' -vf scale=720:-1 -c:v libx264 -crf 18 -preset veryslow -c:a copy 'output'
eneim / c-ss-arousel-pure-css-carousels.markdown
Created Mar 27, 2019
c(ss)arousel - pure CSS carousels 🎪🐎🎪🐎🎪🐎
View c-ss-arousel-pure-css-carousels.markdown

c(ss)arousel - pure CSS carousels 🎪🐎🎪🐎🎪🐎

Pure CSS "carousel"(heavy emphasis on the quotes there)

Leveraging use of how elements behave in the DOM in combination with features of CSS makes implementing a pure CSS "carousel" relatively trivial.

Read more in a blog post here Enjoy!

A Pen by Jhey on CodePen.

eneim / YourFragment.kt
Created Feb 27, 2019 — forked from rylexr/YourFragment.kt
Android navigation bar style with animation
View YourFragment.kt
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = DataBindingUtil.inflate(inflater, R.layout.your_fragment, container, false)
binding.homeAction.setOnClickListener { select( }
binding.likesAction.setOnClickListener { select( }
binding.searchAction.setOnClickListener { select( }
binding.profileAction.setOnClickListener { select( }
return binding.root
fun select(id: Int) {
* Copyright (c) 2018 Nam Nguyen,
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
eneim /
Created Jan 24, 2018 — forked from leonardofed/
A curated list of AWS resources to prepare for the AWS Certifications

A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed

View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
< xmlns:android=""