Skip to content

Instantly share code, notes, and snippets.

View altayalp's full-sized avatar

İzzet Ögetürk altayalp

View GitHub Profile
@altayalp
altayalp / renamer.fxml
Last active August 10, 2016 23:55
My renamer software fxml gui file
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.*?>
<?import javafx.scene.effect.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.image.*?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
@altayalp
altayalp / MysqlMongo.md
Created August 4, 2016 12:46
Migrate some queries from MySQL To MongoDB

Select database

use my_db;

Mysql: Create table. MongoDb: Create collection

CREATE TABLE `users` (
@altayalp
altayalp / ispGood.php
Created August 1, 2016 23:48
ISP (Interface Segregation Principle) good practice
<?php
interface MachineInterface
{
public function open();
public function heatWater();
}
@altayalp
altayalp / ispBad.php
Created August 1, 2016 23:46
ISP (Interface Segregation Principle) bad practice
<?php
interface MachineInterface
{
public function open();
public function heatWater();
public function makeCoffee();
@altayalp
altayalp / Classes.php
Created July 31, 2016 12:36
Php facade design pattern simple and complete example with dependency injection
<?php
class Validate implements ValidateInterface
{
public function isValid(array $data)
{
return true;
}
}
class Auth implements AuthInterface
@altayalp
altayalp / SimpleComboBox.java
Last active July 25, 2016 19:13
Simple javafx ComboBox example
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
@altayalp
altayalp / NotResizable.java
Created July 16, 2016 20:50
Java swing not maximized and resizabled window
import java.awt.Dimension;
import javax.swing.JFrame;
/**
*
* @author altayalp
*/
public class NotResizable {
public static void main(String[] args) {
NotResizable window = new NotResizable();
@altayalp
altayalp / SimpleListView.java
Last active July 6, 2016 14:06
Simple javafx ListView example
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
* Simple javafx listView example
@altayalp
altayalp / HexBackgorundFrame.java
Created July 4, 2016 23:08
Simple example to set hex background color for the JFrame
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
/**
*
* @author altayalp
*/
public class HexBackgorundFrame {
@altayalp
altayalp / get_user.sql
Created July 3, 2016 13:55
Get a list of MySQL user accounts
select user from mysql.user;
# or
select user, host from mysql.user;
# or
select * from mysql.user;