Skip to content

Instantly share code, notes, and snippets.

View mehmetbalbay's full-sized avatar
:octocat:

Mehmet Agah Balbay mehmetbalbay

:octocat:
  • Turkey
View GitHub Profile
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active April 30, 2025 07:51
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@rcgonzalezf
rcgonzalezf / ExampleFragment.kt
Last active March 10, 2020 11:40
Fragment new Instance in Kotlin
package org.rcgonzalezf.kotlin
import android.os.Bundle
import android.support.v4.app.Fragment
class ExampleFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// More logic here
[
{
"il": "Adana",
"plaka": 1,
"ilceleri": [
"Aladağ",
"Ceyhan",
"Çukurova",
"Feke",
"İmamoğlu",
Calendar cal = Calendar.getInstance(Locale.ENGLISH);
cal.setTimeInMillis(timestamp);
String date = DateFormat.format("dd-MM-yyyy hh:mm:ss", cal).toString();
@lopspower
lopspower / README.md
Last active April 30, 2025 09:48
Hexadecimal color code for transparency

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

@ishitcno1
ishitcno1 / Main.java
Created September 29, 2014 07:56
android alert dialog show soft input keyboard
AlertDialog dialog = new AlertDialog.Builder(this).create();
dialog.show();
Window window = dialog.getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
@Tadas44
Tadas44 / BadgeUtils
Created September 15, 2014 13:20
Launcher icon notification for Samsung and Sony Xperia devices
public class BadgeUtils {
public static void setBadge(Context context, int count) {
setBadgeSamsung(context, count);
setBadgeSony(context, count);
}
public static void clearBadge(Context context) {
setBadgeSamsung(context, 0);
@felHR85
felHR85 / SoftKeyboard.java
Last active February 17, 2024 23:11
A solution to catch show/hide soft keyboard events in Android http://felhr85.net/2014/05/04/catch-soft-keyboard-showhidden-events-in-android/
/*
* Author: Felipe Herranz ([email protected])
* Contributors:Francesco Verheye ([email protected])
* Israel Dominguez ([email protected])
*/
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import android.os.Handler;