Skip to content

Instantly share code, notes, and snippets.

View yusufcakal's full-sized avatar
:octocat:
Leave your code better than you found it

Yusuf Çakal yusufcakal

:octocat:
Leave your code better than you found it
View GitHub Profile
ValueEventListener postListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Iterable<DataSnapshot> snapshot = dataSnapshot.child("book").getChildren();
for (DataSnapshot snapshot1 : snapshot) {
Book book = snapshot1.getValue(Book.class);
tvData.setText(book.getName());
}
//tvData.setText(book.getName()); Textview e datayı bind ettik.
}
public class FirebaseUtil {
public static void saveData(){
List<Author> authorList = new ArrayList<>();
Author author1 = new Author("Robert C. Martin");
authorList.add(author1);
Book book = new Book("Clean Code", authorList);
DatabaseReference database = FirebaseDatabase.getInstance().getReference();
DatabaseReference databaseBook = database.child("book");
@yusufcakal
yusufcakal / build.gradle
Created January 19, 2018 23:49
realtime-database
compile 'com.google.firebase:firebase-database:11.8.0'
image = imread('image.png');
image = rgb2gray(image);
disp(max_find(image))
figure;
imshow(image);
function x = max_find(image) % Max fonksiyonunu kullanmadan resim de ki en yüksek piksel değerini bulma.
[w,h] = size(image);
x = image(1,1);
@yusufcakal
yusufcakal / side.m
Last active January 8, 2018 09:45
SideImage
I = imread('image.PNG');
%I = rgb2gray(I);
[r c] = size(I);
result = zeros(r,c);
sub = I;
figure;
imshow(I)
title('Original Image');
for i=2:r-1
for j=2:c-1
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "MyFirebaseMsgService";
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Log.d(TAG, "From: " + remoteMessage.getFrom());
if (remoteMessage.getData().size() > 0) {
package yusufcakal.com.cloudmessagging;
/**
* Created by Yusuf on 19.12.2017.
*/
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_ic_notification" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorAccent" />
<service
android:name=".MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>