Skip to content

Instantly share code, notes, and snippets.

View madalinignisca's full-sized avatar
🏡
Open for business

Madalin Ignisca madalinignisca

🏡
Open for business
View GitHub Profile
@madalinignisca
madalinignisca / 00_twill_vuejs_custom_components_workflow.md
Created October 30, 2021 06:19
Twill Vue.js Components Workflow

Vue.js Workflow - Creating custom components, form fields and blocks in Twill

Objectives:

  • Get an overview of Twill's Artisan commands for development — Part 1
  • Create a custom Vue.js component — Part 2
  • Create a custom Twill form field — Part 3
  • Create a custom Twill block — Part 4
@madalinignisca
madalinignisca / $README.md
Last active December 17, 2021 08:17
PHP on windows

PHP on windows

Edit: running native php on windows sucks!

  1. It is extremly low performant (PHP is designed for UNIX systems and depends on UNIX native libraries)
  2. What works for you on Windows, chances that critical things will break in Linux servers
  3. Windows now has WSL2 and it is awesome!
  4. Docker also :-)

Instalation

Beginners, use latest stable version, for example 8.0.10 at the writing of this gist.

WITH inactive_connections AS (
SELECT
pid,
rank() over (partition by client_addr order by backend_start ASC) as rank
FROM
pg_stat_activity
WHERE
-- Exclude the thread owned connection (ie no auto-kill)
pid <> pg_backend_pid( )
AND
@madalinignisca
madalinignisca / .profile
Last active June 23, 2021 08:37
nodenv phpenv pyenv rbenv
# add this to ~/.profile or correct profile file used by your shell
export RBENV_ROOT="/home/madalin/.rbenv"
if [ -d "${RBENV_ROOT}" ] ; then
PATH="${RBENV_ROOT}/bin:$PATH"
eval "$(rbenv init -)"
fi
export PHPENV_ROOT="/home/madalin/.phpenv"
if [ -d "${PHPENV_ROOT}" ] ; then
@madalinignisca
madalinignisca / .vimrc
Created June 18, 2021 12:24
I love vim so much
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
set laststatus=2 " Always display the statusline in all windows
set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
@madalinignisca
madalinignisca / laravel.css
Created April 14, 2021 08:00
Laravel Docs CSS dark-mode
:root {
--fg: #f0f0f0;
--bg: #222;
--border: #525252;
--well: #303030;
}
body {
color: var(--fg) !important;
background-color: var(--bg) !important;
@madalinignisca
madalinignisca / .env
Created April 13, 2021 17:37
Laravel env with lots of goodies
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:nFiB+9iH3czw93BGTUvW0Ua4j+pQFIn+sUq6IJJzHWI=
APP_DEBUG=true
APP_URL=http://localhost:8000
SANCTUM_STATEFUL_DOMAINS=localhost:3000
SPA_URL=http://localhost:3000
SESSION_DOMAIN=localhost
@madalinignisca
madalinignisca / cloud-init.sh
Last active July 19, 2022 18:26
WordPress on MicroK8s
#!/bin/bash
set -euo pipefail
USERNAME=wpk8s # TODO: Customize the sudo non-root username here
# Create user and immediately expire password to force a change on login
useradd --create-home --shell "/bin/bash" --groups sudo "${USERNAME}"
passwd --delete "${USERNAME}"
chage --lastday 0 "${USERNAME}"
@madalinignisca
madalinignisca / mrfixit.chromium.flags.sh
Created February 1, 2021 08:20
suggested chromium flags that make chromium fast on pinebook pro
# Default settings for chromium-browser. This file is sourced by /bin/sh
# from /usr/bin/chromium-browser
CHROMIUM_FLAGS="$CHROMIUM_FLAGS \
--disable-low-res-tiling \
--num-raster-threads=6 \
--profiler-timing=0 \
--disable-composited-antialiasing \
--test-type \
--show-component-extension-options \
--ignore-gpu-blacklist \
@madalinignisca
madalinignisca / copy-text-from-ssh.bat
Created November 20, 2020 10:38
Copy to windows clipboard from a linux server with ssh
ssh user@yourhost "cat /etc/php/7.4/fpm/php.ini" | clip