Skip to content

Instantly share code, notes, and snippets.

View OzanKurt's full-sized avatar
🍻
Cheers!

Ozan Kurt OzanKurt

🍻
Cheers!
View GitHub Profile
@OzanKurt
OzanKurt / app.css
Created August 15, 2020 03:29 — forked from adamwathan/app.css
/* purgecss start ignore */
@tailwind base;
@tailwind components;
/* purgecss end ignore */
/*
...
...
...other css
...
@OzanKurt
OzanKurt / maxBy.php
Created August 15, 2020 03:30 — forked from adamwathan/maxBy.php
maxBy/minBy macros
<?php
Collection::macro('maxBy', function ($callback) {
$callback = $this->valueRetriever($callback);
return $this->reduce(function ($result, $item) use ($callback) {
if ($result === null) {
return $item;
}
return $callback($item) > $callback($result) ? $item : $result;
<?php
namespace App\Merge;
class Marge
{
protected $data = [];
public function setData($data)
{
@OzanKurt
OzanKurt / Sublime Text 3.2.2 Build 3211 key licence
Created December 22, 2021 08:24 — forked from OrionUnix/Sublime Text 3.2.2 Build 3211 key licence
Sublime Text 3.2.2 Build 3211 key licence
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
@OzanKurt
OzanKurt / pint.json
Created January 13, 2023 01:54 — forked from JustSteveKing/pint.json
Laravel Pint configuration
{
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
@OzanKurt
OzanKurt / event.js
Created January 13, 2023 01:56 — forked from JustSteveKing/event.js
Custom Event Handler
class Event {
constructor() {
this.events = {};
}
fire(event, data) {
const Event = this.events[event];
if( Event ) {
Event.forEach(callback => {
callback.call(null, data);
@OzanKurt
OzanKurt / localStorage.size.js
Created January 13, 2023 01:56 — forked from JustSteveKing/localStorage.size.js
A little script to check the size of your localStorage - for management purposes
let total = 0, amount, item;
for (item in localStorage) {
amount = ((localStorage[item].length + item.length) * 2);
total += amount;
}
console.log(`Total = ${(total / 1024).toFixed(2)}KB`);
@OzanKurt
OzanKurt / localStorage.async.js
Created January 13, 2023 01:56 — forked from JustSteveKing/localStorage.async.js
Using JavaScript Promises to stop render blocking with localStorage
class Storage {
get(item) {
const request = new Promise((resolve, reject) => {
let data = localStorage.getItem(item);
console.log(`Start of promise`);
(data) ? resolve(data) : reject();
});
request.then((data) => {
console.log(`promise resolved`);