Skip to content

Instantly share code, notes, and snippets.

View qWici's full-sized avatar

Ivan Kucher qWici

View GitHub Profile
@georgebent
georgebent / getIp.php
Last active March 3, 2018 08:38
PHP examples
function getIp()
{
//check ip from share internet
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
return $_SERVER['HTTP_CLIENT_IP'];
}
//to check ip is pass from proxy
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
@georgebent
georgebent / changeFileNames.php
Last active June 17, 2023 15:16
PHP examples
<?php
$i = 1;
$path = 'files/'; // path to files
$separator = '-logo-'; // separator to divide the string and take the first part
$errors = [];
foreach (glob($path . '*.*') as $name) {
$filename = basename($name);
$arrayOfString = explode($separator, $filename);
@georgebent
georgebent / appache_settings.txt
Last active March 6, 2018 07:39
Apache 2 Server Settings
<VirtualHost localhost:80>
ServerName test.dev
ServerAlias www.test.dev
DocumentRoot /home/yura/projects/test.dev
<directory /home/yura/projects/test.dev>
AllowOverride All
Require all granted
</directory>
ErrorLog /home/yura/projects/test.dev/logs/error.log
LogLevel warn
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@odan
odan / xampp_php7_xdebug.md
Last active June 28, 2024 12:58
Installing Xdebug for XAMPP
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active July 11, 2024 15:06
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@PurpleBooth
PurpleBooth / README-Template.md
Last active July 17, 2024 03:47
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@singhabhinav
singhabhinav / gist:132b8196abac026b43fa
Last active July 13, 2024 03:32
Install SSL certificate in Nginx (Using .crt & .ca-bundle certificate files)
Step 1 - Create .crt file
cat domainname.crt domainname.ca-bundle > domainname-ssl-bundle.crt
Step 2-
Add lines for ssl_certificate in nginx configuration
server {
listen 80 default_server;
@milanaryal
milanaryal / schema-org-structured-data-markup-using-microdata.html
Last active November 4, 2023 13:45
An example of how to mark up a HTML5 webpage using the schema.org schemas and microdata.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Site Title</title>
<link rel="stylesheet" href="/assets/css/style.min.css">
HTML:
<div class="wrapper">
<div class="tabs">
<span class="tab">Вкладка 1</span>
<span class="tab">Вкладка 2</span>
<span class="tab">Вкладка 3</span>
</div>
<div class="tab_content">
<div class="tab_item">Содержимое 1</div>
<div class="tab_item">Содержимое 2</div>