Skip to content

Instantly share code, notes, and snippets.

View iamcodder's full-sized avatar
💻
I'm learning to new technologies

Süleyman SEZER iamcodder

💻
I'm learning to new technologies
View GitHub Profile
#set( $AwesomeName = "Süleyman SEZER" )
#set( $AwesomeMail = "me.iamcodder@gmail.com" )
/** Code with ❤
╔════════════════════════════╗
║ Created by ${AwesomeName} ║
╠════════════════════════════╣
║ ${AwesomeMail} ║
╠════════════════════════════╣
║ ${DAY}/${MONTH}/${YEAR} - ${TIME} ║
@iamcodder
iamcodder / Git Commit Detaylı Mesaj
Last active February 12, 2020 12:02
Git Commit Detaylı Mesaj
Atom --> $ git config --global core.editor "atom --wait"
nano --> $ git config --global core.editor "nano -w"
Text Wrangler --> $ git config --global core.editor "edit -w"
Sublime Text (Mac) --> $ git config --global core.editor "subl -n -w"
Sublime Text (Win, 32-bit install) --> $ git config --global core.editor "'c:/program files (x86)/sublime text 3/sublime_text.exe' -w"
Sublime Text (Win, 64-bit install) --> $ git config --global core.editor "'c:/program files/sublime text 3/sublime_text.exe' -w"
Notepad++ (Win) --> $ git config --global core.editor "'c:/program files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
Kate (Linux) --> $ git config --global core.editor "kate"
Gedit (Linux) --> $ git config --global core.editor "gedit -s -w"
VS Code --> $ git config --global core.editor "code --wait"
@iamcodder
iamcodder / Databinding Click
Created May 4, 2020 08:55
Databinding farkli türde tiklama eventleri
Many Ways for setting Click
1) Pass handler to binding.
ActivityMainBinding binding = DataBindingUtil.setContentView(this,R.layout.activity_main);
Hander handler = new Handler();
binding.setHandlers(handlers);
2) Set clicks (use any of below)
a) android:onClick="@{handler::onClickMethodReference}"
import java.util.regex.Pattern
fun String.isEmailValid(): Boolean {
val expression = "^[\\w.-]+@([\\w\\-]+\\.)+[A-Z]{2,8}$"
val pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE)
val matcher = pattern.matcher(this)
return matcher.matches()
}
class CustomTimer {
private var ikiSaniye = object : CountDownTimer(
GameTimer.TWO_SECOND.getTimer(),
GameTimer.ONE_SECOND.getTimer()
) {
override fun onFinish() {
}
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
infix fun Activity.extStatusBarColor(color:String){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val window: Window = this.window
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.statusBarColor = Color.parseColor(color)
}
}
this extStatusBarColor "#FFFFFF"
<style name="Theme.AppCompat.Transparent.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
Xml activity -> android:theme="@style/Theme.AppCompat.Transparent.NoActionBar"
@iamcodder
iamcodder / gist:d2f7af2e2bac3d1c843717dcccc313f1
Created June 7, 2020 21:06
Completely trasnparent status bar
Theme :
<item name="android:windowTranslucentStatus" tools:targetApi="kitkat">true</item>
<item name="android:windowTranslucentNavigation" tools:targetApi="kitkat">true</item>
Xml :
android:fitsSystemWindows="true"
@iamcodder
iamcodder / gist:5c8ff93e72ad497a3c7139d2c47a902a
Last active June 16, 2020 17:21
Dart Enum Extension Func
environment:
sdk: ">=2.7.0 <3.0.0"
Private extension (only used in class):
extension on Banana {
// ...
}
Public extension:
extension BananaExtension on Banana {