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
simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
simpleExoPlayerView.requestFocus();
simpleExoPlayerView.setPlayer(player);
MediaSource mediaSource = new HlsMediaSource(Uri.parse("https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"),
mediaDataSourceFactory, mainHandler, null);
player.prepare(mediaSource);
player.setPlayWhenReady(true);
mediaSource = new ExtractorMediaSource(Uri.parse(radioUrl),
dataSourceFactory,
extractorsFactory,
null,
null);
player.prepare(mediaSource);
public class JavaMap {
public static void main(String[] args) {
// Takımları temsil eden kısaltmaları ve isimleri ile Map oluşturuyoruz. Böylece her takım kısaltmasına karşılık takım ismi gelecek.
// put metotu ile ekleme yapıyoruz.
Map<String, String> teamMap = new HashMap<>();
teamMap.put("bjk","Besiktas");
teamMap.put("gs","Galatasaray");
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Thymeleaf Example</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
<title>Hello World Thymeleaf!!</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<p th:text="#{hello}">Hello World Thymeleaf Offline!!</p>
package co.mobiwise.thymeleaf;
/**
* Created by yusuf on 11/11/15.
*/
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@yusufcakmak
yusufcakmak / pom.xml
Created November 11, 2015 20:48
pom.xml for thymeleaf
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>co.mobiwise</groupId>
<artifactId>thymeleaf</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>thymeleaf</name>
@yusufcakmak
yusufcakmak / index.html
Created November 27, 2012 03:22
A CodePen by Yusuf. Interactive Canvas Text - A canvas + js banner, don't forget to interact!
<canvas id='canvas'></canvas>
@yusufcakmak
yusufcakmak / index.html
Created November 27, 2012 03:22
A CodePen by Yusuf. Interactive Canvas Text - A canvas + js banner, don't forget to interact!
<canvas id='canvas'></canvas>
package co.mobiwise.hibernate.app;
import co.mobiwise.hibernate.model.Book;
import co.mobiwise.hibernate.util.HibernateUtil;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projections;