Skip to content

Instantly share code, notes, and snippets.

View umuralpay's full-sized avatar
🎯
$ npx ualpay

Umur Alpay umuralpay

🎯
$ npx ualpay
View GitHub Profile
@umuralpay
umuralpay / docker-compose.yaml
Created October 2, 2022 08:26
Mysql docker-compose
services:
mysql-test-db:
image: mysql:8.0
container_name: mysql-test-db
environment:
MYSQL_DATABASE: 'demo'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
MYSQL_ROOT_HOST: '%'
@umuralpay
umuralpay / product.js
Created April 16, 2021 21:27
Sequelize hide properties from json
'use strict';
import {Model} from "sequelize";
module.exports = (sequelize, DataTypes) => {
class Product extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
@umuralpay
umuralpay / ortho.cs
Last active March 14, 2020 18:49
Unity Ortographic Width And Height
// Height
float orthoSize = gameField.bounds.size.y / 2;
// Width
float orthoSize = gameField.bounds.size.x * Screen.height / Screen.width * 0.5f;
Camera.main.orthographicSize = orthoSize;
//See All
@umuralpay
umuralpay / animation.jsx
Created March 11, 2020 18:10
React Native Animation
const FadeInView = (props) => {
const [fadeAnim] = useState(new Animated.Value(0)) // Initial value for opacity: 0
React.useEffect(() => {
Animated.timing(
fadeAnim,
{
toValue: 1,
duration: 10000,
}
@umuralpay
umuralpay / audio.cs
Created March 10, 2020 16:45
Unity Play Sfx At Camera
AudioSource.PlayClipAtPoint(AudioClip, Camera.main.transform.position);
@umuralpay
umuralpay / unity.cs
Created March 10, 2020 16:31
Unity Singleton
int numGameOfSessions = FindObjectsOfType<GameSession>().Length;
if(numGameOfSessions > 1) {
Destroy(gameObject);
}else {
DontDestroyOnLoad(gameObject);
}