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 / DatabaseNotificationCollection.php
Created December 9, 2016 06:58
Why don't we optimize database interactions?
<?php
namespace Illuminate\Notifications;
use Illuminate\Database\Eloquent\Collection;
class DatabaseNotificationCollection extends Collection
{
/**
* Mark all notification as read.
"initComplete": function () {
var api = this.api();
$('.dataTables_filter:first input').off('.DT').on('keyup.DT', function (e) {
if (e.keyCode == 13) {
api.search(this.value).draw();
}
});
},
@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 / arr_dot.js
Created December 8, 2020 00:51
Laravel's Arr::dot function for Javascript.
/**
* Laravel's Arr::dot function for Javascript.
* IMPORTANT: Requires lodash installed.
*/
function dot(array, prepend) {
results = []
prepend = prepend || ''
$.each(array, function(key, value) {
if ((_.isObject(value) || _.isArray(value)) && ! _.isEmpty(value)) {
@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 / cleanup.js
Last active April 17, 2022 05:39
Clean Up your YouTube
// Delete All Comments
// 1- https://myactivity.google.com/page?page=youtube_comments
// 2- Run the script
let delay = ms => new Promise(res => setTimeout(res, ms));
let btns = document.querySelectorAll('.VfPpkd-Bz112c-LgbsSe.yHy1rc.eT1oJ')
for (let i = 0; i < btns.length; i++) {
console.log(i)
let btn = btns[i]
await delay(500)
@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);