Skip to content

Instantly share code, notes, and snippets.

View blue7wings's full-sized avatar
🤘
fine

Liam Hsia blue7wings

🤘
fine
View GitHub Profile
@blue7wings
blue7wings / clipboard.lua
Created April 19, 2022 13:43
How to enable Neovim's Clipboard in Majanro
-- install xsel at first: `yay -S xsel`
-- add the bellow code in your config file
vim.opt.clipboard = vim.opt.clipboard + {'unnamed','unnamedplus'}
vim.cmd([[
let g:clipboard = {
\ 'name': 'myClipboard',
\ 'copy': {
\ '+': ['xsel', '--nodetach', '-i', '-b'],
\ '*': ['xsel', '--nodetach', '-i', '-p'],
\ },
@blue7wings
blue7wings / php-setup.sh
Last active April 27, 2021 01:39
php dev environment setup in ubuntu
sudo apt-get -y update
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y update
# install php
sudo apt -y install php7.4
# install extensions
sudo apt-get install -y php7.4-{xml,bcmath,bz2,intl,gd,mbstring,mysql,zip,common}
sudo php --version
@blue7wings
blue7wings / default.conf
Last active May 11, 2021 07:44
The Simplest Laravel Docker Environment
server {
listen 80;
server_name center.u1ss.com;
underscores_in_headers on;
index index.php;
charset utf-8;
@blue7wings
blue7wings / docker-install-in-ubuntu.sh
Last active April 26, 2021 11:22
install docker in ubuntu
sudo apt-get -y update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: CentOS/Debian/Ubuntu
# Description: iptables Port forwarding
# Version: 1.1.1
# Author:
# Blog:
@blue7wings
blue7wings / docker-install.sh
Created December 9, 2019 02:34
install docker and compose in CentOS
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
@blue7wings
blue7wings / 1.GIF
Created September 4, 2019 02:17
⁣⁣⁣⁣ 
1.GIF
@blue7wings
blue7wings / AppToFront.cs
Last active April 4, 2019 03:04
bring app to front
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace AppToFront
{
class Program
{
[DllImport("USER32.DLL")]
static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl);
@blue7wings
blue7wings / callNoParamaterFunction.php
Created September 18, 2017 02:52
给无参数定义函数传参
<?php
function greet() : Closure {
return function($name) {
return 'Hello ' . $name;
};
}
function call(Closure $func) {
return function($name) use ($func) {