Skip to content

Instantly share code, notes, and snippets.

View andreyuhai's full-sized avatar
🏠
Working from home

Burak andreyuhai

🏠
Working from home
View GitHub Profile
@andreyuhai
andreyuhai / composer_laravel.md
Last active January 8, 2019 23:48
Creating projects with composer

How to create laravel projects

To create laravel dependent projects using composer:

composer create-project laravel/laravel your_project_name --prefer-dist

@andreyuhai
andreyuhai / apache2.md
Last active January 8, 2019 23:54
apache2 change the root directory to any other

How to change Apache's root directory to some other directory

You'll have to edit apache2.conf and 000-default.conf to change the document root of apache.

The Apache server is installed on var/www/html.This is the default root directory of apache.

Either change the root directory of Apache or move the project to /var/www/html.

To change Apache's root directory, run:

@andreyuhai
andreyuhai / case_usage.sql
Created December 4, 2018 14:13
How to use CASE in MS SQL
WITH Orders (customerID, orderNum) AS
(
SELECT CustomerID, COUNT(*) 'number of orders'
FROM Sales.SalesOrderHeader
GROUP BY CustomerID
)
SELECT customerID, 'Value' =
CASE
WHEN orderNum > (SELECT (AVG(CAST(orderNum AS FLOAT)))
FROM Orders
@andreyuhai
andreyuhai / avg_compare.sql
Created December 4, 2018 14:12
Compare AVG with some other cell
select
cust_id,
gender,
weight
from customer c
WHERE weight > (SELECT AVG(weight)
FROM customer
WHERE gender = c.gender)
order by c.gender
@andreyuhai
andreyuhai / grub.md
Last active September 6, 2020 08:11
backlight fix ubuntu

/etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"

sudo update-grub

if this does not work then try

/etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=video"