Skip to content

Instantly share code, notes, and snippets.

@walish
walish / tmux.conf
Created April 3, 2017 07:05 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@walish
walish / gist:004ab851ff55ffdaa0fbea712bcbbd4f
Created September 27, 2017 04:24 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
[core]
excludesfile = ~/.gitignore
# excludesfile = ~/.gitignore_global
pager = less -FRSX
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
editor = nano
mergeoptions = --no-commit --no-ff
[mergetool]
keepBackup = true
[difftool "sourcetree"]
@walish
walish / php_multiple_versions.md
Created January 17, 2018 11:04 — forked from dhduc/php_multiple_versions.md
Use multiple PHP versions

Use multiple PHP versions

You can use multiple PHP versions with one Apache server. Easily install them via the Apt package manager by the famous PPA from Ondrej. Then you can install multiple PHP versions like so:

sudo apt install php7.1 php5.6 php7.0

For being able to switch the PHP versions within the Apache webserver, you need the Lib Apache packages. You can install them like so:

@walish
walish / xdebug-php.md
Last active July 16, 2018 06:49 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2017

🪲 Install and Configure xDebug on Ubuntu/Mac and PhpStorm 🐘

  • Assuming that you have already installed php and apache
  • Install xDebug php extension
# Ubuntu 18.04, 16.04, php 7.0
sudo apt install php-xdebug

# Ubuntu 14.04, php 5.6 
sudo apt-get install php5-xdebug
#!/bin/sh
# Update
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install software-properties-common
sudo apt-get install python3-software-properties
# Git
sudo apt-get install git git-core -y
@walish
walish / JapaneseRegex.js
Created June 19, 2018 09:24 — forked from ryanmcgrath/JapaneseRegex.js
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation
@walish
walish / regex-101.md
Last active July 16, 2018 08:14
Encountered Regular Expression Cases
  • Replace wrappers around strings Find string
<\?= __\('(.*)?'\) \?>  // <?= __('必須') ?>

Substitution

<!-- ko i18n: '$1'--><!-- /ko --> //<!-- ko i18n: '必須'--><!-- /ko -->
  • Trim unicode/UTF-8 whitespace in PHP

Magento 2: Multiple websites or stores (Apache/Nginx)

Assumptions

  • You have two websites other than the default:
    • us.mysite.com with website code us and store view code us
    • german.mysite.com with website code german and store view code de
    • mysite.com is the default website and default store view
@walish
walish / xampp_php7_xdebug.md
Created May 11, 2019 04:58 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup