Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
the simple, the best

Nam Nguyen Hoai eneim

😀
the simple, the best
View GitHub Profile
@eneim
eneim / README.md
Created Mar 2, 2021 — forked from lopspower/README.md
Hexadecimal color code for transparency
View README.md

Hexadecimal color code for transparency

Twitter

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
eneim / ffmpeg_twitter.sh
Created May 26, 2019
ffmpeg script to encode video for Twitter
View ffmpeg_twitter.sh
ffmpeg -i 'input' -vf scale=720:-1 -c:v libx264 -crf 18 -preset veryslow -c:a copy 'output'
@eneim
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
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(R.id.home_action) }
binding.likesAction.setOnClickListener { select(R.id.likes_action) }
binding.searchAction.setOnClickListener { select(R.id.search_action) }
binding.profileAction.setOnClickListener { select(R.id.profile_action) }
return binding.root
}
fun select(id: Int) {
View Java7LegacyVideoViewHelper.java
/*
* Copyright (c) 2018 Nam Nguyen, nam@ene.im
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@eneim
eneim / README.md
Created Jan 24, 2018 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications
View README.md


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"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start"
>
@eneim
eneim / android_record.sh
Last active Oct 25, 2017
Create Android Screen Record with Android Device Screen.
View android_record.sh
# Modified from https://paul.kinlan.me/android-screen-recording-and-device-framing/
# Original gist: https://gist.github.com/PaulKinlan/2fdb0c8a6b6f6a646f87
# n6-background.png: https://imgur.com/a/r83EX (it is actually Nexus 5X)
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi
ffmpeg="ffmpeg"
@eneim
eneim / Truss.java
Created Oct 2, 2017 — forked from JakeWharton/Truss.java
Extremely simple wrapper around SpannableStringBuilder to make the API more logical and less awful. Apache 2 licensed.
View Truss.java
import android.text.SpannableStringBuilder;
import java.util.ArrayDeque;
import java.util.Deque;
import static android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE;
/** A {@link SpannableStringBuilder} wrapper whose API doesn't make me want to stab my eyes out. */
public class Truss {
private final SpannableStringBuilder builder;
private final Deque<Span> stack;