Skip to content

Instantly share code, notes, and snippets.

View omerkoseoglu's full-sized avatar
🚩
Working

Ömer KÖSEOĞLU omerkoseoglu

🚩
Working
View GitHub Profile
@clandestine8
clandestine8 / Caddyfile
Last active August 29, 2024 10:59
Multi App PHP / Laravel Docker Development Environment using Caddy as Reverse Proxy
app.localhost {
tls internal
root * /srv/App/public
php_fastcgi App:9000 {
root /var/www/public
}
file_server
encode gzip
}
@balazsorban44
balazsorban44 / apple-gen-secret.mjs
Last active April 15, 2025 22:01
Script to generate Apple Client secret
// This is now built into `npx auth add apple`! :tada:
// https://github.com/nextauthjs/cli/pull/10
#!/bin/node
import { SignJWT } from "jose"
import { createPrivateKey } from "crypto"
if (process.argv.includes("--help") || process.argv.includes("-h")) {
@guibranco
guibranco / Dockerfile
Last active March 3, 2025 09:44
Docker file for PHP 7.4 with Apache, MySQLi extension, GD2 and Apache mod_rewrite enabled
FROM php:7.4-apache
RUN apt-get update
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev
RUN a2enmod rewrite
RUN docker-php-ext-install mysqli
RUN docker-php-ext-enable mysqli
@armanozak
armanozak / diacritics.js
Created October 7, 2020 08:50
[Normalize Diacritics] Convert diacritics to Latin-1 (ISO/IEC 8859-1) #tip #javascript
const diacriticsMap = {
: 'a',
: 'A',
: 'a',
á: 'a',
Á: 'A',
à: 'a',
À: 'A',
ă: 'a',
Ă: 'A',
<x-layout>
<x-section>
<x-tabs active="First">
<x-tab name="First">
First content goes here.
</x-tab>
<x-tab name="Second">
Second content goes here.
</x-tab>
class BetterMap<k, v> extends Map<k, v> {
update(key:k, updater: (v:v, k:k) => v, notset:v = undefined) {
if(this.has(key)) this.set(key, updater(this.get(key), key))
else this.set(key, notset)
}
filter(predicate: (v:v, k:k) => boolean) {
const newMap = new BetterMap<k, v>()
const entries = Array.from(this.entries())
for(const [key, value] of entries) {
@DiomedesDominguez
DiomedesDominguez / ApplicationDbContext.cs
Last active July 14, 2023 22:53
The main goal of ModelBuilderExtentions.cs is to use DataAnnotations more in our tables instead of using Fluent. The other files are mere examples.
namespace MyDotNetCore.App
{
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
public class ApplicationDbContext : IdentityDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
@judero01col
judero01col / Service KMS
Last active April 28, 2025 05:41
Volume License Activation Key Service - KMS
## Find Available Target Editions
DISM.exe /Online /Get-TargetEditions
## Convert Server Standard 2019 Evaluation to Server Standard 2019
DISM /online /Set-Edition:ServerStandard /ProductKey:N69G4-B89J2-4G8F4-WWYCC-J464C /AcceptEula
## How To Activate
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /skms [server]:[port]
slmgr /ato
@Jagathishrex
Jagathishrex / main.js
Last active February 24, 2023 17:11
converting string to camel case
// util function to convert the input to string type
function convertToString(input) {
if(input) {
if(typeof input === "string") {
return input;
}
@meSingh
meSingh / JsonMiddleware.php
Last active July 11, 2022 09:19
If you are using laravel as api only, you might want to return JSON on every request, even on errors/exceptions. The easiest way to do so is using this middleware globally.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class JsonMiddleware
{
public function handle(Request $request, Closure $next)