Skip to content

Instantly share code, notes, and snippets.

View Syakhisk's full-sized avatar
💻
most likely on my laptop at the moment

Syakhisk Al-Azmi Syakhisk

💻
most likely on my laptop at the moment
View GitHub Profile
@YPetremann
YPetremann / README.md
Created November 11, 2021 01:33
AwesomeWM easier binding

AwesomeWM easier key and mouse binding

Make it easier to define bindings by :

  • providing groups of bindings depending of context
  • provide a way to define every any bindings in one place (not mandatory through)
  • mixing key and mouse bindings (mouse bindings are detected as such and automaticaly moved to a separate set)
  • mouse bindings have more indicative alias (LMB, RMB, MWU, MWD)
  • easy text based binding definition
  • easy text based documentation definition
  • one time definition for multiple time usage (client, client_titlebar, taglists ...)
  • permit to pass parameters to bindings from specific context (client, tags, screens ...)
@Tymek
Tymek / useNavigationLock.ts
Last active May 25, 2023 22:38
Next.js block navigation on unsaved changes
import { useEffect, useState } from 'react';
import { useRouter } from 'next/router';
/** Ask for confirmation before changing page or leaving site.
*
* @see https://git.io/JOskG
*/
const useNavigationLock = (
isEnabled = true,
warningText = 'You have unsaved changes – are you sure you wish to leave this page?',
@thugcee
thugcee / tmux-switch-pane.sh
Created January 11, 2021 22:56
tmux and fzf: fuzzy tmux session/window/pane switcher (this version uses tmux new popup window)
#!/bin/bash
# customizable
LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}"
FZF_COMMAND="fzf-tmux -p --delimiter=: --with-nth 4 --color=hl:2"
# do not change
TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:"
# select pane
@typebrook
typebrook / README.md
Last active June 19, 2024 05:55
A bash script for gist management #bash #gist
@dazfuller
dazfuller / Pipfile
Last active January 3, 2024 18:48
Multi-process loading of data into MySQL from Python
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
mysql-connector-python = "*"
@bbqtd
bbqtd / macos-tmux-256color.md
Last active July 16, 2024 21:16
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@juliendargelos
juliendargelos / imagemagick-trim-transparent.sh
Last active October 23, 2023 02:31
Imagemagick command that trims transparent pixels from an image.
convert input.png -trim +repage output.png
@bradtraversy
bradtraversy / docker_wordpress.md
Last active July 11, 2024 00:07
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@leogallego
leogallego / ubuntu-cloud-virtualbox.sh
Last active October 17, 2023 09:04 — forked from smoser/ubuntu-cloud-virtualbox.sh
Ubuntu Cloud images with cloud-init and cloud-config for virtualbox
## Install necessary packages and latest virtualbox
wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'
sudo apt update
sudo apt install virtualbox-5.2 qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
## WARNING: not needed?
#sudo modprobe -r kvm_amd kvm_intel
#sudo service virtualbox stop
@ibrahimtuzlak0295
ibrahimtuzlak0295 / xampp-virtualhost.md
Last active May 24, 2023 16:21
Create virtual host in XAMPP, Ubuntu 16.04/18.04/20.04/22.04

I’ll go step-by-step on how to create a virtual host in the XAMPP environment. As we know, the default http://localhost points to /opt/lampp/htdocs as the root directory. The desired result is to be able to visit http://examplevhost.local, with the root directory being /opt/lampp/htdocs/examplevhost.

Note: The steps below are done on Ubuntu 16.04, but they should also work on most other Linux distributions (Debian, Mint, Arch).

Note: I’ll assume that XAMPP is installed in /opt/lampp/. If it’s different on your setup, please read carefully and adjust accordingly.

Enable virtual hosts in apache configuration file

Note: This should be done only once per XAMPP installation. If you want to add another virtual host later you can skip to the next step.