Skip to content

Instantly share code, notes, and snippets.

View yusufcakmak's full-sized avatar
🏠
Working from home

Yusuf Cakmak yusufcakmak

🏠
Working from home
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/Book</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
package co.mobiwise.hibernate.util;
/**
* Created by yusufcakmak on 8/3/15.
*/
import java.util.Properties;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
public void deleteBook(Book book) {
Session session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.delete(book);
session.getTransaction().commit();
}
compile 'com.google.android.exoplayer:exoplayer:r2.X.X'
@yusufcakmak
yusufcakmak / build.gradle
Last active December 1, 2018 14:12
exogradlemodules
implementation 'com.google.android.exoplayer:exoplayer-core:2.X.X'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.X.X'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.X.X'
@yusufcakmak
yusufcakmak / hibernate.cfg.xml
Created August 4, 2015 13:18
HibernateCRUDExample
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://localhost:3306/book</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<com.yusufcakmak.exoplayersample.customview.CustomExoPlayerView
android:id="@+id/custom_player_view"
android:focusable="true"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
private void updatePlayPauseButton() {
if (!isVisible() || !isAttachedToWindow) {
return;
}
boolean playing = player != null && player.getPlayWhenReady();
String contentDescription = getResources().getString(
playing ? com.google.android.exoplayer2.R.string.exo_controls_pause_description : com.google.android.exoplayer2.R.string.exo_controls_play_description);
playButton.setContentDescription(contentDescription);
playButton.setImageResource(
playing ? R.drawable.pausecontrol : R.drawable.playcontrol);
@yusufcakmak
yusufcakmak / gist:b19371a0c9c22f5c04ff8b461b422ffd
Created November 17, 2016 20:18 — forked from iammert/gist:faa6cd996c752dcfb10a
update gitignore already commited
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
git push origin master
extractorsFactory = new DefaultExtractorsFactory();
MediaSource mediaSource = new ExtractorMediaSource(Uri.parse("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"),
mediaDataSourceFactory, extractorsFactory, null, null);