Skip to content

Instantly share code, notes, and snippets.

View turgayozgur's full-sized avatar
👾
Focusing

Turgay turgayozgur

👾
Focusing
View GitHub Profile
@turgayozgur
turgayozgur / aspnetcore-linux-deployment.sh
Last active March 6, 2023 13:38
ASPNET Core Zero Downtime Deployment to Linux with Nginx
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# How to use?
# https://medium.com/@ozgurtrgy/aspnet-core-zero-downtime-deployment-to-linux-with-nginx-b8b230bf1577
# the variables depend on you.
PACKAGE_TAR_NAME="artifacts.tar.gz"
VERSION="1005"
@turgayozgur
turgayozgur / nginx-lua-remove-non-ascii-from-cookie.conf
Last active November 26, 2018 11:44
Removing non ascii characters from request cookies for nginx
@turgayozgur
turgayozgur / qor-auth-password-handlers.go
Last active September 12, 2019 12:02
/go/src/github.com/qor/auth/providers/password/handlers.go
package password
import (
"reflect"
"strings"
"github.com/qor/auth"
"github.com/qor/auth/auth_identity"
"github.com/qor/auth/claims"
"github.com/qor/qor/utils"
@turgayozgur
turgayozgur / whereequal.cs
Last active May 3, 2017 10:42
C# Generate Expression to Select with Where
private IQueryable<T> WhereEqual<T>(IQueryable query, string prop, object param)
{
var select = Expression.Parameter(typeof(T), "select");
MemberExpression property = null;
foreach (var node in prop.Split('.'))
{
property = property == null
? Expression.Property(select, node)
: Expression.Property(property, node);
@turgayozgur
turgayozgur / magneto2geoipindex.php
Last active November 20, 2016 00:00
Magento2 index.php with GeoIP2
<?php
/**
* Application entry point
*
* Example - run a particular store or website:
* --------------------------------------------
* require __DIR__ . '/app/bootstrap.php';
* $params = $_SERVER;
* $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
* $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';