Skip to content

Instantly share code, notes, and snippets.

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

Mehmet Hanoğlu mhanoglu

🏠
Working from home
View GitHub Profile
@isneezy
isneezy / elementaryos.md
Created December 22, 2019 08:37 — forked from Surendrajat/elementaryos.md
elementaryOS | Things To Do After Installing elementary OS Hera(5.1)

First Things First

  • Enable PPA

     sudo apt update
     sudo apt install software-properties-common
  • Install apt-fast

@brunojppb
brunojppb / setup_redmine_4_ubuntu.md
Last active November 29, 2022 03:19
How to setup Redmine 4 on Ubuntu 18.04

How to setup Redmine 4 on Ubuntu 18.04

Prerequisites:

Full SSH root access or a user with sudo privileges.

Step 1: Connect to your Server

To connect to your server via SSH as the root user, use the following command:

@jxlwqq
jxlwqq / admin.php
Last active June 3, 2023 19:05
Create upload path based on current year and month
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel-admin upload setting
|--------------------------------------------------------------------------
|
| File system configuration for form upload files and images, including
| disk and upload path.
|
@jxlwqq
jxlwqq / verification.php
Last active November 3, 2022 04:11
Input verification on front and back ends
<?php
protected function form()
{
$form = new Form(new ModelName);
$form->text('title')->rules('required')->required()->help('This field must be required');
$form->text('number')->rules('required|regex:/\d{3}/')->pattern('\d{3}')->help('This field must be three digits');
return $form;
}
@daftspunk
daftspunk / ajax-file-upload.htm
Created July 29, 2017 07:52
Sample AJAX file upload via October CMS
title = "AJAX File Upload"
url = "/test"
layout = "default"
is_hidden = 0
==
<?php
use System\Models\File;
function onSubmit()
{
@emir
emir / tax_validation.php
Last active December 26, 2023 18:40
PHP Vergi Numarası Doğrulama
<?php
/**
* This method logically validates Turkish VAT number
*
* @param string $taxNumber
* @return bool
*/
public function validateTaxNumber(string $taxNumber): bool
{
@james2doyle
james2doyle / dd.php
Last active June 29, 2024 00:58
A implementation of "dump and die" (dd) for WordPress
<?php
if (!function_exists('dd')) {
function dd($data)
{
ini_set("highlight.comment", "#969896; font-style: italic");
ini_set("highlight.default", "#FFFFFF");
ini_set("highlight.html", "#D16568");
ini_set("highlight.keyword", "#7FA3BC; font-weight: bold");
ini_set("highlight.string", "#F2C47E");
@aaronbloomfield
aaronbloomfield / multiple-php-versions-on-ubuntu-16.04.md
Last active July 9, 2020 01:53
Running multiple PHP versions on Apache2 and Ubuntu 16.04

Setting up multiple apache2 instances on Ubuntu 16.04

PHP handling on apache is done via modules of one sort or another, and running multiple version is problematic on a single instance. The solution is to run two instances of apache on the same machine. This allows one instance to run PHP 7 (the default on 16.04), and another can run PHP 5. Since normal http/https is on ports 80 and 443, the second instance will run on ports 81 and 444. Since it is running on the same machine, all file system and database access is the exact same.

All the commands herein have to be run as root, or with sudo prefixed to the command.

  1. Read /usr/share/doc/apache2/README.multiple-instances

  2. Run sh ./setup-instance php5 from /usr/share/doc/apache2/examples, where php5 is the suffix for the second site; all commands for the second site will have that suffix. This will keep all of the same configuration for all sites on the new instance, including SSL certif

install nodejs & npm

sudo apt-get install nodejs
sudo apt-get install npm

fix naming issue of node to ubuntu

ln -s /usr/bin/nodejs /usr/bin/node
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Requests;
use App\Article;
use App\Tag;
use App\Category;
use Zofe\Rapyd\DataForm\Field\Checkboxgroup;
class AdminArticlesController extends AdminController