Skip to content

Instantly share code, notes, and snippets.

View m-inan's full-sized avatar

Minan m-inan

  • Turkey, Bursa
  • 03:35 (UTC +03:00)
View GitHub Profile
@m-inan
m-inan / Spring.java
Last active May 5, 2023 21:56
Android Java Spring Animation
package com.example.spring;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@m-inan
m-inan / .prettierrc
Last active September 9, 2021 14:18
Prettier Config file Typescript
{
"semi": true,
"tabWidth": 2,
"singleQuote": true,
bracketSpacing: true,
arrowParens: "avoid"
}
@m-inan
m-inan / date.js
Created March 20, 2020 00:43
JavaScript Time Ago Calculator (Türkçe)
function timeSince(date) {
const seconds = Math.floor((new Date() - new Date(date)) / 1000)
const values = {'yıl': 31536000, 'ay': 2592000, 'gün': 86400, 'saat': 3600, 'dakika': 60}
for ( const key in values ) {
const time = Math.floor(seconds / values[key])
if ( time > 1) {
return `${time} ${key}`
function matrixTransform(matrix, point) {
const {a, b, c, d, e, f} = matrix;
const {x, y} = point;
return {
x: a * x + c * y + e,
y: b * x + d * y + f,
};
}
@m-inan
m-inan / matrixInvers.js
Created October 5, 2019 16:18
Matrix Inverse
function invert({a, b, c, d, e, f}) {
const n = a * d - b * c;
return {
a: d / n,
b: -b / n,
c: -c / n,
d: a / n,
e: (c * f - d * e) / n,
f: -(a * f - b * e) / n,
};
@m-inan
m-inan / .eslintrc
Created July 9, 2019 19:56
Nodejs Esling Configration
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
@m-inan
m-inan / .eslintrc
Last active January 1, 2020 20:57
React Eslint Configrution
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
{
"semi": false,
"tabWidth": 2,
"singleQuote": true
}