This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display last month commit of author | |
git log --since='last month' --pretty=format:' %Cred%h%Creset ; %C(bold blue)%an%Creset ; %C(yellow)%ad%Creset ; %Cgreen%s%Creset ' --date=format:'%Y-%m-%d %H:%M:%S' --author=AUTHOR_NAME | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.myapplication | |
import android.app.AlertDialog | |
import android.app.Dialog | |
import android.graphics.drawable.ColorDrawable | |
import android.os.Bundle | |
import android.view.LayoutInflater | |
import androidx.fragment.app.DialogFragment | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update | |
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT | |
iptables -A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.fontFamily": "Monaco, 'Courier New', monospace", | |
"workbench.colorTheme": "Darcula Theme from IntelliJ", | |
"editor.tabSize": 2, | |
"react.beautify.onSave": true, | |
"editor.formatOnSave": true, | |
"files.exclude": { | |
"**/.git": true, | |
"**/.svn": true, | |
"**/.hg": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String hexColor = String.format("#%06X", (0xFFFFFF & -16776961)); | |
Integer intColor = -16895234; | |
String hexColor = "#" + Integer.toHexString(intColor).substring(2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.security.KeyManagementException; | |
import java.security.KeyStore; | |
import java.security.KeyStoreException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.security.UnrecoverableKeyException; | |
import java.security.cert.CertificateException; | |
import java.util.Arrays; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ColorDrawable drawable=new ColorDrawable(); | |
drawable.setColor(getResources().getColor(R.color.colorPrimary)); | |
drawable.setAlpha(-verticalOffset * 255 / appBarLayout.getTotalScrollRange()); | |
toolbar.setBackground(drawable); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.Copy postgresql jar glassfish4/glassfish/domains/domain1/lib/ext | |
2.start glassfish | |
asadmin start-domain | |
3.Create Connection Pool (DataSource) | |
asadmin create-jdbc-connection-pool | |
--datasourceclassname org.postgresql.ds.PGSimpleDataSource | |
--restype javax.sql.DataSource | |
--property user=USER_NAME:password=PASSWORD:DatabaseName=DB_NAME:ServerName=HOST_NAME:port=PORT_NAME | |
postgresql-pool(DataSource Name) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mdpi @ 1.00dp = 1.00px | |
hdpi @ 1.00dp = 1.50px | |
xhdpi @ 1.00dp = 2.00px | |
xxhdpi @ 1.00dp = 3.00px | |
xxxhdpi @ 1.00dp = 4.00px |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TabLayout text color selector when using cutom view | |
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- Active tab --> | |
<item android:color="@android:color/holo_red_dark" android:state_focused="false" android:state_pressed="false" android:state_selected="true" /> | |
<!-- Inactive tab --> | |
<item android:color="#000" android:state_focused="false" android:state_pressed="false" android:state_selected="false" /> | |
<!-- Pressed tab --> | |
<item android:color="#000" android:state_pressed="true" /> |
NewerOlder