Skip to content

Instantly share code, notes, and snippets.

View sergromanenko1's full-sized avatar

Sergey Romanenko sergromanenko1

  • Ukraine, Luhansk region, Antratsyt
View GitHub Profile
@mzaglia
mzaglia / hyper-v-static-ip.md
Last active March 7, 2024 09:02
Static IP Hyper-V Ubuntu VM

First in a powershell create a new network switch

New-VMSwitch -SwitchName "SwitchName" -SwitchType Internal
Get-NetAdapter       // (note down ifIndex of the newly created switch as INDEX)
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex <INDEX>
New-NetNat -Name MyNATnetwork -InternalIPInterfaceAddressPrefix 192.168.0.0/24

In your ubuntu server open your network netplan

@domske
domske / safari-fix-overflow-border-radius.md
Last active June 13, 2024 14:09
Bugfix (Workaround) for Safari (iOS): Border radius with overflow hidden does not work as expected.

There is a bug in Safari when using border-radius and overflow: hidden. Especially when applying transform to a child. In this case, overflow: hidden does not always work. The child ignores the border radius and overflows. It's a very old bug. And sadly it seems that it will never be fixed. Anyway, we can't wait for it.

There are some workaround. We need to place the element with the overflow attribute into a stacking context. I've tested the following workarounds on the latest version of iOS (14.4). You can choose what you want. But you should search the web for the particular attribute. (e.g. will-change should be rarely used. See docs)

Use this on the element with overflow: hidden and border-radius:

Установка Composer на OpenServer

cd modules/php/PHP-7.0-x64/

Проверка в \OSPanel\userdata\config\PHP-7.0-x64_php.ini "extension=php_openssl.dll"

php -r "readfile('https://getcomposer.org/installer');" | php

php composer.phar -V

@estorgio
estorgio / Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS.md
Last active June 19, 2024 15:50
Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

Update 28 July 2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Update 23 May 2020: This guide is ALREADY OUTDATED and might no longer work with new versions of Ubuntu and VirtualBox. Please consider switching to the updated guide instead. I will no longer respond to the replies to this gist. Thank you.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

@solancer
solancer / apache-nginx-ftp
Created July 27, 2016 10:53
Correct permissions for /var/www/html
// Adding current user to www-data
sudo adduser $USER www-data
//change ownership to user:www-data and
sudo chown $USER:www-data -R /var/www/html
sudo chmod u=rwX,g=srX,o=rX -R /var/www/html
// change file permissions of existing files and folders to 755/644
sudo find /var/www/html -type d -exec chmod g=rwxs "{}" \;
@wesbos
wesbos / tab-trigger.js
Created November 16, 2015 19:33
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@bcamarneiro
bcamarneiro / Single Value from mysqli PHP.php
Created April 22, 2014 15:14
Return single value from mysqli PHP
$name = $mysqli->query("SELECT name FROM contacts WHERE id = 5")->fetch_object()->name;
@joshuadavidnelson
joshuadavidnelson / remove-default-taxonomies.php
Created November 13, 2013 04:41
Remove category and tag taxonomies. Useful if you're not using the blog functionality of WordPress, including the taxonomies. Be sure to uncomment the other line if you're using Genesis to avoid errors.
<?php
/**
*
* Remove default taxonomies
*
* @link http://w4dev.com/wp/remove-taxonomy/
*
*/
add_action( 'init', 'unregister_taxonomy');
@Warry
Warry / Article.md
Created December 11, 2012 00:11
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows: